Beispiel #1
0
        public void TrialWallPts()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db  = doc.Database;

            List <Line> lstWallLines = new List <Line>();

            ObjectId lyrWallId = ObjectId.Null;

            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                //wall layer
                LayerTable lyrTbl = trans.GetObject(db.LayerTableId, OpenMode.ForRead) as LayerTable;
                if (!lyrTbl.Has("Wall"))
                {
                    return;
                }
                lyrWallId = lyrTbl["Wall"];
                //LayerTableRecord lyrTblRecWall = trans.GetObject(lyrWallId, OpenMode.ForRead) as LayerTableRecord;



                Editor ed = doc.Editor;
                PromptSelectionResult prSelRes = ed.GetSelection();
                if (prSelRes.Status == PromptStatus.OK)
                {
                    SelectionSet selSet = prSelRes.Value;
                    IEnumerator  itr    = selSet.GetEnumerator();

                    while (itr.MoveNext())
                    {
                        SelectedObject lineObj = itr.Current as SelectedObject;

                        if (lineObj != null)
                        {
                            Entity lineEnt = trans.GetObject(lineObj.ObjectId, OpenMode.ForRead) as Entity;
                            Line   line    = lineEnt as Line;
                        }
                    }
                }
            }
        }
Beispiel #2
0
        public void TcQuTongShanChu()
        {
            int    num;
            int    num6;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                long num3 = Conversions.ToLong(Interaction.InputBox("输入通筋面积", "田草CAD工具箱-板筋去通删除", "", -1, -1));
IL_27:
                num2 = 3;
                if (num3 != 0L)
                {
                    goto IL_3C;
                }
IL_37:
                goto IL_1EA;
IL_3C:
                num2 = 6;
IL_3E:
                num2 = 7;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_4B:
                num2 = 8;
                Database database = mdiActiveDocument.Database;
IL_55:
                num2 = 9;
                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);
                            double         num4           = NF.CVal(dbtext.TextString);
                            if (num4 <= (double)num3)
                            {
                                dbtext.Erase();
                            }
                            else
                            {
                                dbtext.TextString = Conversions.ToString(num4 - (double)num3);
                            }
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_15F:
                goto IL_1EA;
IL_164:
                int num5 = num6 + 1;
                num6     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num5);
IL_1A4:
                goto IL_1DF;
IL_1A6:
                num6 = num2;
                if (num <= -2)
                {
                    goto IL_164;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_1BC :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num6 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_1A6;
            }
IL_1DF:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1EA:
            if (num6 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #3
0
        public void TcQuJianShanChu()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                string text = Interaction.InputBox("输入数值区间:\r\nA,B  删除A~B之间的数值\r\nA,   删除小于等于A的数值\r\n,B   删除大于等于B的数值", "田草CAD工具箱-数值区间删除", "", -1, -1);
IL_22:
                num2 = 3;
                if (Operators.CompareString(text, "", false) != 0)
                {
                    goto IL_3A;
                }
IL_35:
                goto IL_341;
IL_3A:
                num2 = 6;
IL_3C:
                num2 = 7;
                string[] array = text.Split(new char[]
                {
                    ','
                });
IL_53:
                num2 = 8;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_61:
                num2 = 9;
                Database database = mdiActiveDocument.Database;
IL_6D:
                num2 = 10;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array2 = new TypedValue[1];
                    Array        array3 = array2;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "TEXT");
                    array3.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array2);
                    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);
                            NF.CVal(dbtext.TextString);
                            if (array.Length >= 2)
                            {
                                if ((Operators.CompareString(array[0], "", false) != 0 & Operators.CompareString(array[1], "", false) != 0) && (NF.CVal(dbtext.TextString) >= Conversion.Val(array[0]) & NF.CVal(dbtext.TextString) <= Conversion.Val(array[1])))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                                if ((Operators.CompareString(array[0], "", false) != 0 & Operators.CompareString(array[1], "", false) == 0) && NF.CVal(dbtext.TextString) <= Conversion.Val(array[0]))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                                if ((Operators.CompareString(array[0], "", false) == 0 & Operators.CompareString(array[1], "", false) != 0) && NF.CVal(dbtext.TextString) >= Conversion.Val(array[1]))
                                {
                                    Class36.smethod_64(dbtext.ObjectId);
                                }
                            }
                            else if (array.Length == 1 && NF.CVal(dbtext.TextString) <= Conversion.Val(array[0]))
                            {
                                Class36.smethod_64(dbtext.ObjectId);
                            }
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_2B2:
                goto IL_341;
IL_2B7:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_2FB:
                goto IL_336;
IL_2FD:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_2B7;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_313 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_2FD;
            }
IL_336:
            throw ProjectData.CreateProjectError(-2146828237);
IL_341:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #4
0
        public void TcE8200()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[2];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "TEXT");
                    array2.SetValue(typedValue, 0);
                    Array array3 = array;
                    typedValue..ctor(1, "%%1328@200");
                    array3.SetValue(typedValue, 1);
                    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);
                            Class36.smethod_64(dbtext.ObjectId);
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_11A:
                goto IL_186;
IL_11C:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_140:
                goto IL_17B;
IL_142:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_11C;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_158 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_142;
            }
IL_17B:
            throw ProjectData.CreateProjectError(-2146828237);
IL_186:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #5
0
        public void TcFace()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[1];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "3DFACE");
                    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;
                            Face           face           = (Face)transaction.GetObject(selectedObject.ObjectId, 1);
                            Interaction.MsgBox(face.GetVertexAt(0).ToString(), MsgBoxStyle.OkOnly, null);
                            CAD.AddPoint(face.GetVertexAt(0));
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_121:
                num2 = 6;
                if (Information.Err().Number <= 0)
                {
                    goto IL_146;
                }
IL_132:
                num2 = 7;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_146:
                goto IL_1C2;
IL_148:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_17C:
                goto IL_1B7;
IL_17E:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_148;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_194 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_17E;
            }
IL_1B7:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1C2:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #6
0
        public void TcWmfout()
        {
            int    num;
            int    num9;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Editor editor = Application.DocumentManager.MdiActiveDocument.Editor;
IL_28:
                num2 = 4;
                Database database = mdiActiveDocument.Database;
IL_32:
                num2 = 5;
                BlockTableRecord blockTableRecord = new BlockTableRecord();
IL_3B:
                num2 = 6;
                blockTableRecord.Name = "*U";
IL_49:
                num2 = 7;
                BlockReference blockReference = null;
IL_4E:
                num2 = 8;
                editor.WriteMessage("你可以使用wmfopts命令,预先设置wmf输出选项\r\n");
IL_5B:
                num2 = 9;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    BlockTable            blockTable = (BlockTable)transaction.GetObject(database.BlockTableId, 1);
                    PromptSelectionResult selection  = mdiActiveDocument.Editor.GetSelection();
                    if (selection.Status == 5100)
                    {
                        SelectionSet value    = selection.Value;
                        Entity       entity   = (Entity)transaction.GetObject(value[0].ObjectId, 0);
                        Point3d      minPoint = entity.GeometricExtents.MinPoint;
                        blockTableRecord.Origin = minPoint;
                        IEnumerator enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            Entity         entity2        = (Entity)transaction.GetObject(selectedObject.ObjectId, 1);
                            Entity         entity3        = (Entity)entity2.Clone();
                            blockTableRecord.AppendEntity(entity3);
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                        blockTable.Add(blockTableRecord);
                        transaction.AddNewlyCreatedDBObject(blockTableRecord, true);
                        BlockTableRecord blockTableRecord2 = (BlockTableRecord)transaction.GetObject(blockTable[BlockTableRecord.ModelSpace], 1);
                        blockReference = new BlockReference(minPoint, blockTableRecord.ObjectId);
                        blockTableRecord2.AppendEntity(blockReference);
                        transaction.AddNewlyCreatedDBObject(blockReference, true);
                        Point3d minPoint2      = blockReference.GeometricExtents.MinPoint;
                        Point3d maxPoint       = blockReference.GeometricExtents.MaxPoint;
                        object  systemVariable = Application.GetSystemVariable("TARGET");
                        Point3d point3d2;
                        Point3d point3d = (systemVariable != null) ? ((Point3d)systemVariable) : point3d2;
                        maxPoint..ctor(maxPoint.X - point3d.X, maxPoint.Y - point3d.Y, maxPoint.Z - point3d.Z);
                        minPoint2..ctor(minPoint2.X - point3d.X, minPoint2.Y - point3d.Y, minPoint2.Z - point3d.Z);
                        checked
                        {
                            long num3 = (long)Math.Round(unchecked (maxPoint.get_Coordinate(1) - minPoint2.get_Coordinate(1)));
                            long num4 = (long)Math.Round(unchecked (maxPoint.get_Coordinate(0) - minPoint2.get_Coordinate(0)));
                        }
                        double num5 = Math.Abs(minPoint2.get_Coordinate(0) - maxPoint.get_Coordinate(0));
                        double num6 = Math.Abs(minPoint2.get_Coordinate(1) - maxPoint.get_Coordinate(1));
                        double num7 = num5 / num6;
                        num5 = 1000.0;
                        num6 = num5 / num7;
                        mdiActiveDocument.Window.WindowState = 0;
                        Size deviceIndependentSize = new Size(num5, num6);
                        mdiActiveDocument.Window.DeviceIndependentSize = deviceIndependentSize;
                        exportWmf.SetView(minPoint2, maxPoint, 1.05);
                    }
                    transaction.Commit();
                }
IL_314:
                num2 = 11;
                mdiActiveDocument.Editor.WriteMessage("WMF 自动输出到 \"c:\\\\temp.wmf\"\r\n");
IL_327:
                num2 = 12;
                mdiActiveDocument.SendStringToExecute("(command \"wmfout\" \"c:\\\\temp.wmf\" (handent \"" + blockReference.Handle.ToString() + "\"))\r\n", false, false, false);
IL_358:
                num2 = 13;
                Thread.Sleep(2000);
IL_365:
                num2 = 14;
                if (Information.Err().Number == 0)
                {
                    goto IL_391;
                }
IL_37A:
                num2 = 15;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
                goto IL_3BD;
IL_391:
                num2 = 17;
IL_394:
                num2 = 18;
                MsgBoxResult msgBoxResult = Interaction.MsgBox("WMF  文件成功导出到  c:\\temp.wmf\r\n\r\n你是否需要打开此文件?", MsgBoxStyle.YesNo, null);
IL_3A5:
                num2 = 19;
                if (msgBoxResult != MsgBoxResult.Yes)
                {
                    goto IL_3BD;
                }
IL_3AF:
                num2 = 20;
                Process.Start("c:\\temp.wmf");
IL_3BD:
                goto IL_474;
IL_3C2:
                int num8 = num9 + 1;
                num9     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num8);
IL_42E:
                goto IL_469;
IL_430:
                num9 = num2;
                if (num <= -2)
                {
                    goto IL_3C2;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_446 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num9 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_430;
            }
IL_469:
            throw ProjectData.CreateProjectError(-2146828237);
IL_474:
            if (num9 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #7
0
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(SelectionSet.GetEnumerator());
 }
Beispiel #8
0
        /// <summary>
        /// Returns an enumeration of the current selection set for this CQ object
        /// </summary>
        ///
        /// <returns>
        /// The enumerator.
        /// </returns>

        public IEnumerator <IDomObject> GetEnumerator()
        {
            return(SelectionSet.GetEnumerator());
        }
Beispiel #9
0
        private void Button2_Click(object sender, EventArgs e)
        {
            int    num;
            int    num4;
            object obj2;

            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.arrayList_0 = new ArrayList();
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 ((!this.arrayList_0.Contains(text) & text.Contains("@")) && TcBJFJ_frm.GetBJAS(text) > this.long_0)
                            {
                                this.arrayList_0.Add(text);
                            }
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                    }
                    transaction.Commit();
                }
IL_17C:
                num2 = 9;
                this.TextBox1.Text = "";
IL_18F:
                num2 = 10;
                this.TextBox4.Text = "";
IL_1A2:
                num2             = 11;
                this.arrayList_1 = new ArrayList();
IL_1B0:
                num2 = 12;
                IEnumerator enumerator2 = this.arrayList_0.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    object value2 = enumerator2.Current;
                    string text2  = Conversions.ToString(value2);
IL_1D3:
                    num2 = 13;
                    long bjas = TcBJFJ_frm.GetBJAS(text2);
IL_1DF:
                    num2 = 14;
                    this.arrayList_1.Add(bjas);
IL_1F5:
                    num2 = 15;
                    this.TextBox4.Text = this.TextBox4.Text + Conversions.ToString(bjas) + "\r\n";
IL_21F:
                    num2 = 16;
                    this.TextBox1.Text = this.TextBox1.Text + text2 + "\r\n";
IL_244:
                    num2 = 17;
                }
                if (enumerator2 is IDisposable)
                {
                    (enumerator2 as IDisposable).Dispose();
                }
IL_26E:
                num2 = 18;
                this.XGJ_sub();
IL_277:
                num2 = 19;
                if (Information.Err().Number <= 0)
                {
                    goto IL_28E;
                }
IL_289:
                goto IL_3A3;
IL_28E:
                num2 = 22;
IL_291:
                num2 = 23;
                this.Button1.Enabled = true;
IL_2A0:
                num2 = 25;
                documentLock.Dispose();
IL_2AA:
                num2 = 26;
                if (Information.Err().Number <= 0)
                {
                    goto IL_2D1;
                }
IL_2BC:
                num2 = 27;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_2D1:
                goto IL_3A3;
IL_2D6:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_35A:
                goto IL_398;
IL_35C:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_2D6;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_375 :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_35C;
            }
IL_398:
            throw ProjectData.CreateProjectError(-2146828237);
IL_3A3:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #10
0
        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();
            }
        }
Beispiel #11
0
        public object GetGuJinPoint(ref Point3d P1, ref Point3d P2)
        {
            int    num;
            object obj2;
            int    num8;
            object obj3;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[1];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "LWPOLYLINE");
                    array2.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        Entity       e          = (Entity)transaction.GetObject(value[0].ObjectId, 0);
                        Point3d      entCenter  = CAD.GetEntCenter(e);
                        double       num3       = entCenter.X;
                        double       num4       = entCenter.Y;
                        double       num5       = entCenter.X;
                        double       num6       = entCenter.Y;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            e         = (Entity)transaction.GetObject(selectedObject.ObjectId, 0);
                            entCenter = CAD.GetEntCenter(e);
                            num3      = Math.Min(entCenter.X, num3);
                            num4      = Math.Min(entCenter.Y, num4);
                            num5      = Math.Max(entCenter.X, num5);
                            num6      = Math.Max(entCenter.Y, num6);
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                        P1..ctor(num3, num4, 0.0);
                        P2..ctor(num5, num6, 0.0);
                    }
                    transaction.Commit();
                }
IL_1AC:
                num2 = 6;
                if (Information.Err().Number <= 0)
                {
                    goto IL_1D1;
                }
IL_1BD:
                num2 = 7;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_1D1:
                num2 = 9;
                obj2 = true;
IL_1E1:
                goto IL_261;
IL_1E3:
                int num7 = num8 + 1;
                num8     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num7);
IL_21B:
                goto IL_256;
IL_21D:
                num8 = num2;
                if (num <= -2)
                {
                    goto IL_1E3;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_233 :;
            }
            catch when(endfilter(obj3 is Exception & num != 0 & num8 == 0))
            {
                Exception ex = (Exception)obj4;

                goto IL_21D;
            }
IL_256:
            throw ProjectData.CreateProjectError(-2146828237);
IL_261:
            object result = obj2;

            if (num8 != 0)
            {
                ProjectData.ClearProjectError();
            }
            return(result);
        }
Beispiel #12
0
        public void TcQZGJ_Layer()
        {
            int    num;
            int    num4;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Class36.SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle);
IL_25:
                num2 = 3;
                DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument();
IL_37:
                num2 = 4;
                CAD.CreateLayer("墙柱小箍筋", 14, "continuous", -3, false, true);
IL_4F:
                num2 = 5;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_5C:
                num2 = 6;
                Database database = mdiActiveDocument.Database;
IL_66:
                num2 = 7;
                TypedValue[] array = new TypedValue[1];
IL_70:
                num2 = 8;
                Array      array2 = array;
                TypedValue typedValue;
                typedValue..ctor(0, "LWPOLYLINE");
                array2.SetValue(typedValue, 0);
IL_8E:
                num2 = 9;
                SelectionFilter selectionFilter = new SelectionFilter(array);
IL_9A:
                num2 = 10;
                PromptSelectionResult selection = mdiActiveDocument.Editor.GetSelection(selectionFilter);
IL_AC:
                num2 = 11;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    SelectionSet value      = selection.Value;
                    IEnumerator  enumerator = value.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        object         obj            = enumerator.Current;
                        SelectedObject selectedObject = (SelectedObject)obj;
                        CAD.ChangeLayer(selectedObject.ObjectId, "墙柱小箍筋");
                    }
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                    transaction.Commit();
                }
IL_130:
                num2 = 13;
                documentLock.Dispose();
IL_139:
                goto IL_1CC;
IL_13E:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_186:
                goto IL_1C1;
IL_188:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_13E;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_19E :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_188;
            }
IL_1C1:
            throw ProjectData.CreateProjectError(-2146828237);
IL_1CC:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
Beispiel #13
0
        public void TcQGJ_X()
        {
            int    num;
            int    num8;
            object obj2;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_16:
                num2 = 3;
                Database database = mdiActiveDocument.Database;
IL_1F:
                num2 = 4;
                using (Transaction transaction = database.TransactionManager.StartTransaction())
                {
                    TypedValue[] array  = new TypedValue[1];
                    Array        array2 = array;
                    TypedValue   typedValue;
                    typedValue..ctor(0, "LWPOLYLINE");
                    array2.SetValue(typedValue, 0);
                    SelectionFilter       selectionFilter = new SelectionFilter(array);
                    PromptSelectionResult selection       = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    if (selection.Status == 5100)
                    {
                        SelectionSet value      = selection.Value;
                        Entity       e          = (Entity)transaction.GetObject(value[0].ObjectId, 0);
                        Point3d      entCenter  = CAD.GetEntCenter(e);
                        double       num3       = entCenter.X;
                        double       num4       = entCenter.Y;
                        double       num5       = entCenter.X;
                        double       num6       = entCenter.Y;
                        IEnumerator  enumerator = value.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            object         obj            = enumerator.Current;
                            SelectedObject selectedObject = (SelectedObject)obj;
                            e         = (Entity)transaction.GetObject(selectedObject.ObjectId, 0);
                            entCenter = CAD.GetEntCenter(e);
                            num3      = Math.Min(entCenter.X, num3);
                            num4      = Math.Min(entCenter.Y, num4);
                            num5      = Math.Max(entCenter.X, num5);
                            num6      = Math.Max(entCenter.Y, num6);
                        }
                        if (enumerator is IDisposable)
                        {
                            (enumerator as IDisposable).Dispose();
                        }
                        Point3d point3d_;
                        point3d_..ctor(num3, num4, 0.0);
                        Point3d point3d_2;
                        point3d_2..ctor(num5, num6, 0.0);
                        Class36.smethod_14(point3d_, point3d_2, Class36.double_0 / 2.0);
                    }
                    transaction.Commit();
                }
IL_1C7:
                num2 = 6;
                if (Information.Err().Number <= 0)
                {
                    goto IL_1EC;
                }
IL_1D8:
                num2 = 7;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_1EC:
                goto IL_268;
IL_1EE:
                int num7 = num8 + 1;
                num8     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num7);
IL_222:
                goto IL_25D;
IL_224:
                num8 = num2;
                if (num <= -2)
                {
                    goto IL_1EE;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_23A :;
            }
            catch when(endfilter(obj2 is Exception & num != 0 & num8 == 0))
            {
                Exception ex = (Exception)obj3;

                goto IL_224;
            }
IL_25D:
            throw ProjectData.CreateProjectError(-2146828237);
IL_268:
            if (num8 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }