public static bool GetFuJinDBText(Entity Ent, double Dist, string LayerName, double Angle, ref DBObjectCollection DBCT) { TypedValue[] array = new TypedValue[1]; Array array2 = array; TypedValue typedValue; typedValue..ctor(0, "Text"); array2.SetValue(typedValue, 0); if (Operators.CompareString(LayerName, "", false) != 0) { array = (TypedValue[])Utils.CopyArray((Array)array, new TypedValue[2]); Array array3 = array; typedValue..ctor(8, LayerName); array3.SetValue(typedValue, 1); } Point3d maxPoint = Ent.GeometricExtents.MaxPoint; Point3d minPoint = Ent.GeometricExtents.MinPoint; Point3dCollection point3dCollection = new Point3dCollection(); Point3dCollection point3dCollection2 = point3dCollection; Point3d point3d; point3d..ctor(minPoint.X - Dist, minPoint.Y - Dist, 0.0); point3dCollection2.Add(point3d); Point3dCollection point3dCollection3 = point3dCollection; point3d..ctor(minPoint.X - Dist, maxPoint.Y + Dist, 0.0); point3dCollection3.Add(point3d); Point3dCollection point3dCollection4 = point3dCollection; point3d..ctor(maxPoint.X + Dist, maxPoint.Y + Dist, 0.0); point3dCollection4.Add(point3d); Point3dCollection point3dCollection5 = point3dCollection; point3d..ctor(maxPoint.X + Dist, minPoint.Y - Dist, 0.0); point3dCollection5.Add(point3d); DBObjectCollection dbobjectCollection = CAD.CrossingPolygon(point3dCollection, array); if (dbobjectCollection.Count >= 1) { try { foreach (object obj in dbobjectCollection) { DBText dbtext = (DBText)obj; if (!DBCT.Contains(dbtext)) { double num = dbtext.Rotation; if (num > 6.2831853071795862) { num -= 6.2831853071795862; } if (Math.Abs(num - Angle) < 0.01) { DBCT.Add(dbtext); TcBJFJ_frm.GetFuJinDBText(dbtext, Dist, LayerName, Angle, ref DBCT); } } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } bool result; return(result); }
public static bool GetFuJinPL(Entity Ent, double Dist, string LayerName, double Angle, ref DBObjectCollection DBC) { TypedValue[] array = new TypedValue[1]; Array array2 = array; TypedValue typedValue; typedValue..ctor(0, "LWPOLYLINE"); array2.SetValue(typedValue, 0); if (Operators.CompareString(LayerName, "", false) != 0) { array = (TypedValue[])Utils.CopyArray((Array)array, new TypedValue[2]); Array array3 = array; typedValue..ctor(8, LayerName); array3.SetValue(typedValue, 1); } Point3d maxPoint = Ent.GeometricExtents.MaxPoint; Point3d minPoint = Ent.GeometricExtents.MinPoint; Point3dCollection point3dCollection = new Point3dCollection(); Point3dCollection point3dCollection2 = point3dCollection; Point3d point3dAt; point3dAt..ctor(minPoint.X - Dist, minPoint.Y - Dist, 0.0); point3dCollection2.Add(point3dAt); Point3dCollection point3dCollection3 = point3dCollection; point3dAt..ctor(minPoint.X - Dist, maxPoint.Y + Dist, 0.0); point3dCollection3.Add(point3dAt); Point3dCollection point3dCollection4 = point3dCollection; point3dAt..ctor(maxPoint.X + Dist, maxPoint.Y + Dist, 0.0); point3dCollection4.Add(point3dAt); Point3dCollection point3dCollection5 = point3dCollection; point3dAt..ctor(maxPoint.X + Dist, minPoint.Y - Dist, 0.0); point3dCollection5.Add(point3dAt); DBObjectCollection dbobjectCollection = CAD.CrossingPolygon(point3dCollection, array); if (dbobjectCollection.Count >= 1) { try { foreach (object obj in dbobjectCollection) { Polyline polyline = (Polyline)obj; if (!DBC.Contains(polyline)) { point3dAt = polyline.GetPoint3dAt(1); point3dAt.GetVectorTo(polyline.GetPoint3dAt(2)).AngleOnPlane(new Plane()); Line line = new Line(polyline.GetPoint3dAt(1), polyline.GetPoint3dAt(2)); if (Math.Abs(line.Angle - Math.Abs(Angle)) < 0.01) { DBC.Add(polyline); TcBJFJ_frm.GetFuJinDBText(polyline, Dist, LayerName, Angle, ref DBC); } } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } bool result; return(result); }
private void Button1_Click(object sender, EventArgs e) { int num; int num6; object obj4; try { IL_01: ProjectData.ClearProjectError(); num = -2; IL_09: int num2 = 2; Class36.SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle); IL_25: num2 = 3; Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; IL_32: num2 = 4; Database database = mdiActiveDocument.Database; IL_3B: num2 = 5; DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument(); IL_4E: num2 = 6; this.objectIdCollection_0 = new ObjectIdCollection(); IL_5B: num2 = 7; using (Transaction transaction = database.TransactionManager.StartTransaction()) { TypedValue[] array = new TypedValue[1]; Array array2 = array; TypedValue typedValue; typedValue..ctor(0, "TEXT"); array2.SetValue(typedValue, 0); SelectionFilter selectionFilter = new SelectionFilter(array); PromptSelectionResult selection = mdiActiveDocument.Editor.GetSelection(selectionFilter); if (selection.Status == 5100) { SelectionSet value = selection.Value; IEnumerator enumerator = value.GetEnumerator(); while (enumerator.MoveNext()) { object obj = enumerator.Current; SelectedObject selectedObject = (SelectedObject)obj; DBText dbtext = (DBText)transaction.GetObject(selectedObject.ObjectId, 1); string text = JG.HRB(dbtext.TextString); if (text.Contains("@")) { if (this.RadioButton2.Checked) { if (TcBJFJ_frm.GetBJAS(text) <= this.long_0) { DBObjectCollection dbobjectCollection = new DBObjectCollection(); double num3 = dbtext.Rotation; if (num3 > 6.2831853071795862) { num3 -= 6.2831853071795862; } TcBJFJ_frm.GetFuJinDBText(dbtext, dbtext.Height * 3.0, "楼板负筋标注", num3, ref dbobjectCollection); IEnumerator enumerator2 = dbobjectCollection.GetEnumerator(); while (enumerator2.MoveNext()) { object obj2 = enumerator2.Current; DBText dbtext2 = (DBText)obj2; Class36.smethod_64(dbtext2.ObjectId); } if (enumerator2 is IDisposable) { (enumerator2 as IDisposable).Dispose(); } dbobjectCollection = new DBObjectCollection(); TcBJFJ_frm.GetFuJinPL(dbtext, dbtext.Height * 2.0, "楼板负筋钢筋", num3, ref dbobjectCollection); IEnumerator enumerator3 = dbobjectCollection.GetEnumerator(); while (enumerator3.MoveNext()) { object obj3 = enumerator3.Current; Polyline polyline = (Polyline)obj3; Class36.smethod_64(polyline.ObjectId); } if (enumerator3 is IDisposable) { (enumerator3 as IDisposable).Dispose(); } dbtext.Erase(); } else { this.objectIdCollection_0.Add(dbtext.ObjectId); dbtext.TextString = dbtext.TextString.Replace("@", "@#"); } } else if (TcBJFJ_frm.GetBJAS(text) <= this.long_0) { Class36.smethod_64(dbtext.ObjectId); } else { this.objectIdCollection_0.Add(dbtext.ObjectId); dbtext.TextString = dbtext.TextString.Replace("@", "@#"); } } } if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } transaction.Commit(); } IL_319: num2 = 9; string[] array3 = this.TextBox1.Text.Split(new char[] { '\r' }); IL_33E: num2 = 10; string[] array4 = this.TextBox2.Text.Split(new char[] { '\r' }); IL_363: num2 = 11; string[] array5 = array3; int i = 0; checked { while (i < array5.Length) { string text2 = array5[i]; IL_379: num2 = 12; Application.DoEvents(); IL_381: num2 = 13; if (Operators.CompareString(text2.Trim(), "", false) != 0) { IL_3A1: num2 = 14; int num4 = Array.IndexOf <string>(array3, text2); IL_3AF: num2 = 15; text2 = text2.Trim(); IL_3BB: num2 = 16; text2 = text2.Replace("\r\n", ""); IL_3D1: num2 = 17; text2 = text2.Replace("@", "@#"); IL_3E7: num2 = 18; array4[num4] = array4[num4].Trim(); IL_3F9: num2 = 19; array4[num4] = array4[num4].Replace("\r\n", ""); IL_415: num2 = 20; array4[num4] = array4[num4].Replace("11@", "10/12@"); IL_431: num2 = 21; array4[num4] = array4[num4].Replace("13@", "12/14@"); IL_44D: num2 = 22; array4[num4] = array4[num4].Replace("15@", "14/16@"); IL_469: num2 = 23; array4[num4] = array4[num4].Replace("17@", "16/18@"); IL_485: num2 = 24; array4[num4] = array4[num4].Replace("19@", "18/20@"); IL_4A1: num2 = 25; array4[num4] = array4[num4].Replace("21@", "20/22@"); IL_4BD: num2 = 26; this.ChangeTxt(text2, array4[num4], 6L); } IL_4D7: i++; IL_4DD: num2 = 28; } IL_4ED: num2 = 29; documentLock.Dispose(); IL_4F7: num2 = 30; if (Information.Err().Number <= 0) { goto IL_51E; } IL_509: num2 = 31; Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null); IL_51E: goto IL_600; IL_523 :; } int num5 = num6 + 1; num6 = 0; @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num5); IL_5B7: goto IL_5F5; IL_5B9: num6 = num2; if (num <= -2) { goto IL_523; } @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num); IL_5D2 :; } catch when(endfilter(obj4 is Exception & num != 0 & num6 == 0)) { Exception ex = (Exception)obj5; goto IL_5B9; } IL_5F5: throw ProjectData.CreateProjectError(-2146828237); IL_600: if (num6 != 0) { ProjectData.ClearProjectError(); } }