public void TcSOREC() { int num; int num2; object obj; try { ProjectData.ClearProjectError(); num = 2; Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; Database database = mdiActiveDocument.Database; using (Transaction transaction = database.TransactionManager.StartTransaction()) { BlockTable blockTable = (BlockTable)transaction.GetObject(database.BlockTableId, 0); BlockTableRecord blockTableRecord = (BlockTableRecord)transaction.GetObject(blockTable[BlockTableRecord.ModelSpace], 1); Point3d point3d; Point3d point3d2; Class36.smethod_33(ref point3d, ref point3d2); Point3d point3d3; point3d3..ctor(point3d.get_Coordinate(0), point3d2.get_Coordinate(1), 0.0); Point3d point3d4; point3d4..ctor(point3d2.get_Coordinate(0), point3d.get_Coordinate(1), 0.0); Solid solid = new Solid(point3d, point3d4, point3d3, point3d2); solid.SetDatabaseDefaults(); blockTableRecord.AppendEntity(solid); transaction.AddNewlyCreatedDBObject(solid, true); transaction.Commit(); } goto IL_138; IL_E1: Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null); goto IL_138; IL_F5: num2 = -1; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); IL_10A :; } catch when(endfilter(obj is Exception & num != 0 & num2 == 0)) { Exception ex = (Exception)obj2; goto IL_F5; } throw ProjectData.CreateProjectError(-2146828237); IL_138: if (num2 != 0) { ProjectData.ClearProjectError(); } }
public void TcZhuShi1() { Database workingDatabase = HostApplicationServices.WorkingDatabase; Editor editor = Application.DocumentManager.MdiActiveDocument.Editor; Point3d point3d; Point3d point3d2; short num = (-((Class36.smethod_33(ref point3d, ref point3d2) > false) ? 1 : 0)) ? 1 : 0; if (num != 0) { this.double_0 = Math.Abs(point3d.X - point3d2.X); this.double_1 = Math.Abs(point3d.Y - point3d2.Y); this.point3d_0..ctor((point3d.X + point3d2.X) / 2.0, (point3d.Y + point3d2.Y) / 2.0, 0.0); PromptResult promptResult = editor.Drag(this); if (promptResult.Status == 5100) { CAD.AddEnt(this.entity_0[0]); CAD.AddEnt(this.entity_0[1]); this.dbtext_0 = new DBText(); this.dbtext_0.Height = Math.Min(0.7 * Math.Min(this.double_0, this.double_1), Math.Max(this.double_0, this.double_1) / 8.0); this.dbtext_0.WidthFactor = 0.7; this.dbtext_0.TextString = "请在这里输入内容"; if (this.double_0 < this.double_1) { this.dbtext_0.Rotation = 1.5707963267948966; } else { this.dbtext_0.Rotation = 0.0; } this.dbtext_0.SetDatabaseDefaults(); this.dbtext_0.HorizontalMode = 1; this.dbtext_0.VerticalMode = 2; this.dbtext_0.AlignmentPoint = this.point3d_0; CAD.AddEnt(this.dbtext_0); } } }
public void TcZhuShi2() { CAD.CreateLayer("注释", 1, "continuous", 30, false, false); Application.SetSystemVariable("LWDISPLAY", 1); Database workingDatabase = HostApplicationServices.WorkingDatabase; Editor editor = Application.DocumentManager.MdiActiveDocument.Editor; Point3d point3d; Point3d point3d2; short num = (-((Class36.smethod_33(ref point3d, ref point3d2) > false) ? 1 : 0)) ? 1 : 0; if (num != 0) { this.double_0 = Math.Abs(point3d.X - point3d2.X); this.double_1 = Math.Abs(point3d.Y - point3d2.Y); this.point3d_0..ctor((point3d.X + point3d2.X) / 2.0, (point3d.Y + point3d2.Y) / 2.0, 0.0); PromptResult promptResult = editor.Drag(this); if (promptResult.Status == 5100) { CAD.AddEnt(this.entity_0[0]); this.dbtext_0 = new DBText(); double num2 = this.double_0 / 8.0; this.dbtext_0.TextString = "请在这里输入内容"; if (num2 > 0.7 * this.double_1) { this.dbtext_0.Height = 0.7 * this.double_1; } else { this.dbtext_0.Height = num2; } this.dbtext_0.SetDatabaseDefaults(); this.dbtext_0.HorizontalMode = 1; this.dbtext_0.VerticalMode = 2; this.dbtext_0.AlignmentPoint = this.point3d_0; CAD.AddEnt(this.dbtext_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(); } }