Exemple #1
0
        public void TcRecHatch()
        {
            int    num;
            int    num4;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Polyline polyline = new Polyline();
IL_11:
                num2 = 3;
                Point3d point3d_;
                Point3d point3d_2;
                Class36.smethod_33(ref point3d_, ref point3d_2);
IL_1D:
                num2     = 4;
                polyline = Class36.smethod_17(point3d_, point3d_2);
IL_28:
                num2 = 5;
                string text = Conversions.ToString(Application.GetSystemVariable("CPROFILE"));
IL_3B:
                num2 = 6;
                if (Operators.CompareString(text.ToUpper().Substring(0, 4), "TSSD", false) != 0)
                {
                    goto IL_66;
                }
IL_5B:
                num2 = 7;
                string text2 = "AN31C";
                goto IL_A0;
IL_66:
                num2 = 9;
                if (Operators.CompareString(text.ToUpper().Substring(0, 4), "TARC", false) != 0)
                {
                    goto IL_93;
                }
IL_87:
                num2  = 10;
                text2 = "钢筋混凝土";
                goto IL_A0;
IL_93:
                num2 = 12;
IL_96:
                num2  = 13;
                text2 = "ARMORED";
IL_A0:
                num2 = 15;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_AF:
                num2 = 16;
                Database database = mdiActiveDocument.Database;
IL_BB:
                num2 = 17;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    BlockTable         blockTable         = (BlockTable)transaction.GetObject(database.BlockTableId, 0);
                    BlockTableRecord   blockTableRecord   = (BlockTableRecord)transaction.GetObject(blockTable[BlockTableRecord.ModelSpace], 1);
                    ObjectIdCollection objectIdCollection = new ObjectIdCollection();
                    objectIdCollection.Add(polyline.ObjectId);
                    Hatch hatch = new Hatch();
                    blockTableRecord.AppendEntity(hatch);
                    transaction.AddNewlyCreatedDBObject(hatch, true);
                    hatch.SetDatabaseDefaults();
                    hatch.PatternScale = 25.0;
                    hatch.SetHatchPattern(1, text2);
                    hatch.Associative = true;
                    hatch.AppendLoop(16, objectIdCollection);
                    hatch.EvaluateHatch(true);
                    transaction.Commit();
                }
IL_184:
                num2 = 19;
                Class36.smethod_64(polyline.ObjectId);
IL_193:
                num2 = 20;
                if (Information.Err().Number <= 0)
                {
                    goto IL_1BA;
                }
IL_1A5:
                num2 = 21;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_1BA:
                goto IL_271;
IL_1BF:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_22B:
                goto IL_266;
IL_22D:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_1BF;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_243 :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_22D;
            }
IL_266:
            throw ProjectData.CreateProjectError(-2146828237);
IL_271:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }