Ejemplo n.º 1
0
        // by hying 2011/10/31  判断模型是否出错
        public bool checkModel()
        {
            model2.EditRebuild3();

            ModelDocExtension swModelDocExt = default(ModelDocExtension);
            object            oFeatures;
            object            oErrorCodes;
            object            oWarnings;

            object[] Features   = null;
            int[]    ErrorCodes = null;
            bool[]   Warnings   = null;
            bool     boolstatus = false;

            int     nbrWhatsWrong = 0;
            Feature swFeature     = default(Feature);

            swModelDocExt = (ModelDocExtension)model2.Extension;

            nbrWhatsWrong = swModelDocExt.GetWhatsWrongCount();
            string a = "Number of What's Wrong items: " + nbrWhatsWrong;

            if (nbrWhatsWrong > 0)
            {
                boolstatus = swModelDocExt.GetWhatsWrong(out oFeatures, out oErrorCodes, out oWarnings);
                Features   = (object[])oFeatures;
                ErrorCodes = (int[])oErrorCodes;

                Warnings = (bool[])oWarnings;
                //for (int i = 0; i < Features.Length; i++)
                {
                    swFeature = (Feature)Features[0];
                    //object[] swFeature_1 = (object[])swFeature.GetParents();

                    a = " 零件特征: " + swFeature.Name + "存在问题!";
                    WriteLog(a, 2);
                    Utility.ModelErrorList.AppendLine(a);
                }
                return(false);
            }

            return(true);
        }