コード例 #1
0
        private void TcFind_Frm_FormClosing(object sender, FormClosingEventArgs e)
        {
            int    num;
            int    num4;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Interaction.SaveSetting(Class33.Class31_0.Info.ProductName, "_FindFrm", "Text_1", this.TextBox1.Text);
IL_34:
                num2 = 3;
                Interaction.SaveSetting(Class33.Class31_0.Info.ProductName, "_FindFrm", "Text_2", this.TextBox2.Text);
IL_5F:
                num2 = 4;
                DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument();
IL_71:
                num2 = 5;
                Class36.smethod_64(this.entity_0.ObjectId);
IL_84:
                num2 = 6;
                documentLock.Dispose();
IL_8C:
                goto IL_FC;
IL_8E:
                int num3 = num4 + 1;
                num4     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num3);
IL_B8:
                goto IL_F1;
IL_BA:
                num4 = num2;
                if (num <= -2)
                {
                    goto IL_8E;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_CF :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num4 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_BA;
            }
IL_F1:
            throw ProjectData.CreateProjectError(-2146828237);
IL_FC:
            if (num4 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
コード例 #2
0
        public void TcDuanMianByLine()
        {
            Point3d p;
            Point3d p2;

            Class36.smethod_31(ref p, ref p2, "选择插入点:");
            Line   line = CAD.AddLine(p, p2, "0");
            string text = Interaction.InputBox("直接距离" + Conversions.ToString(checked ((long)Math.Round(line.Length))) + ",请输入分布的钢筋根数", "", "2", -1, -1);

            if (Operators.CompareString(text, "", false) != 0)
            {
                double num  = line.Length / (Conversions.ToDouble(text) + 1.0);
                double num2 = Class36.double_0 / 2.0;
                double num3 = num2;
                short  num4;
                short  num6;
                short  num7;
                checked
                {
                    if (num3 == 1.0)
                    {
                        num4 = (short)Math.Round(unchecked (35.0 * num2));
                    }
                    else if (num3 == 1.25)
                    {
                        num4 = (short)Math.Round(unchecked (30.0 * num2));
                    }
                    else if (num3 == 2.0)
                    {
                        num4 = (short)Math.Round(unchecked (25.0 * num2));
                    }
                    else if (num3 == 2.5)
                    {
                        num4 = (short)Math.Round(unchecked (25.0 * num2));
                    }
                    short num5 = 1;
                    num6 = Conversions.ToShort(text);
                    num7 = num5;
                }
                for (;;)
                {
                    short num8 = num7;
                    short num9 = num6;
                    if (num8 > num9)
                    {
                        break;
                    }
                    Point3d pointAtDist = line.GetPointAtDist(num * (double)num7);
                    Class36.smethod_16(pointAtDist, (double)num4, "墙柱纵筋");
                    num7 += 1;
                }
                Class36.smethod_64(line.ObjectId);
            }
        }
コード例 #3
0
        public void TcGangJin()
        {
            this.double_0 = CAD.GetScale();
            CAD.CreateLayer("钢筋", 14, "continuous", -1, false, true);
            this.point2dCollection_0 = new Point2dCollection();
            this.point3d_1           = CAD.GetPoint("选择插入点: ");
            Point3d point3d;

            if (!(this.point3d_1 == point3d))
            {
                Point2dCollection point2dCollection = this.point2dCollection_0;
                Point2d           point2d;
                point2d..ctor(this.point3d_1.X, this.point3d_1.Y);
                point2dCollection.Add(point2d);
                Polyline polyline  = new Polyline();
                ObjectId objectId_ = default(ObjectId);
                for (;;)
                {
                    short num = checked ((short)(this.point2dCollection_0.Count - 1));
                    if (num >= 1)
                    {
                        Class36.smethod_64(objectId_);
                        polyline = new Polyline();
                        polyline.SetDatabaseDefaults();
                        short num2 = 0;
                        short num3 = num;
                        short num4 = num2;
                        for (;;)
                        {
                            short num5 = num4;
                            short num6 = num3;
                            if (num5 > num6)
                            {
                                break;
                            }
                            polyline.AddVertexAt((int)num4, this.point2dCollection_0[(int)num4], 0.0, 45.0 * this.double_0, 45.0 * this.double_0);
                            num4 += 1;
                        }
                        polyline.Layer = "钢筋";
                        objectId_      = Class36.smethod_92(polyline);
                    }
                    short num7 = this.GangJin();
                    if (num7 != 1)
                    {
                        break;
                    }
                    this.point3d_1 = this.point3d_2;
                    Point2dCollection point2dCollection2 = this.point2dCollection_0;
                    point2d..ctor(this.point3d_2.X, this.point3d_2.Y);
                    point2dCollection2.Add(point2d);
                }
            }
        }
コード例 #4
0
ファイル: 打砖块.cs プロジェクト: 1833183060/autocad-dev
 public void timer1_Tick(object sender, EventArgs e)
 {
     this.document_0.LockDocument();
     if (!this.bool_0)
     {
         CAD.EntMove(this.circle_0.Id, this.circle_0.Center, CAD.GetPointAR_Radian(this.point3d_0, this.double_3, this.double_4 * this.double_2));
         Class36.smethod_64(this.objectId_0);
         this.bool_0 = true;
     }
     else
     {
         CAD.EntMove(this.circle_0.Id, this.circle_0.Center, CAD.GetPointAR_Radian(this.circle_0.Center, this.double_3, this.double_4 * this.double_2));
         this.Zhuangji();
     }
     this.document_0.Editor.UpdateScreen();
 }
コード例 #5
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();
            }
        }
コード例 #6
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();
            }
        }
コード例 #7
0
        private void Button1_Click(object sender, EventArgs e)
        {
            int    num;
            int    num13;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                this.document_0.SendStringToExecute("\u0003\u0003", false, false, false);
IL_1E:
                num2 = 3;
                if (Operators.CompareString(this.TextBox1.Text, "", false) != 0)
                {
                    goto IL_4E;
                }
IL_3B:
                num2 = 4;
                this.TextBox1.Focus();
IL_49:
                goto IL_6EB;
IL_4E:
                num2 = 7;
                DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument();
IL_60:
                num2 = 8;
                long     num3 = (long)this.int_0;
                string   textString;
                long     num7;
                Point3d  maxPoint;
                Point3d  minPoint;
                Polyline polyline;
                Polyline polyline2;
                int      num8;
                checked
                {
                    long num4 = this.long_0 - 1L;
                    this.long_1 = num3;
                    DBText dbtext;
                    for (;;)
                    {
                        long num5 = this.long_1;
                        long num6 = num4;
                        if (num5 <= num6)
                        {
IL_90:
                            num2 = 9;
                            using (Transaction transaction = this.database_0.TransactionManager.StartTransaction())
                            {
                                dbtext     = (DBText)transaction.GetObject(this.selectionSet_0[(int)this.long_1].ObjectId, 1);
                                textString = dbtext.TextString;
                                goto IL_118;
                            }
IL_E8:
                            num2 = 12;
                            if (num7 <= 0L)
                            {
IL_FA:
                                num2         = 44;
                                this.long_1 += 1L;
                                continue;
                            }
                            break;
IL_118:
                            num2 = 11;
                            num7 = unchecked ((long)Strings.InStr(textString, this.TextBox1.Text, CompareMethod.Binary));
                            goto IL_E8;
                        }
                        goto IL_4F2;
                    }
IL_133:
                    num2     = 13;
                    maxPoint = dbtext.GeometricExtents.MaxPoint;
IL_148:
                    num2     = 14;
                    minPoint = dbtext.GeometricExtents.MinPoint;
IL_15D:
                    num2 = 15;
                    Class36.smethod_64(this.entity_0.ObjectId);
IL_171:
                    num2     = 16;
                    polyline = new Polyline();
IL_17B:
                    num2 = 17;
                    polyline.SetDatabaseDefaults();
IL_185:
                    num2      = 18;
                    polyline2 = polyline;
                    num8      = 0;
                }
                Point2d point2d;
                point2d..ctor(minPoint.X - 100.0, minPoint.Y - 100.0);
                polyline2.AddVertexAt(num8, point2d, 0.0, 20.0, 20.0);
IL_1D6:
                num2 = 19;
                Polyline polyline3 = polyline;
                int      num9      = 1;
                point2d..ctor(minPoint.X - 100.0, maxPoint.Y + 100.0);
                polyline3.AddVertexAt(num9, point2d, 0.0, 20.0, 20.0);
IL_227:
                num2 = 20;
                Polyline polyline4 = polyline;
                int      num10     = 2;
                point2d..ctor(maxPoint.X + 100.0, maxPoint.Y + 100.0);
                polyline4.AddVertexAt(num10, point2d, 0.0, 20.0, 20.0);
IL_278:
                num2 = 21;
                Polyline polyline5 = polyline;
                int      num11     = 3;
                point2d..ctor(maxPoint.X + 100.0, minPoint.Y - 100.0);
                polyline5.AddVertexAt(num11, point2d, 0.0, 20.0, 20.0);
IL_2C9:
                num2            = 22;
                polyline.Closed = true;
IL_2D4:
                num2 = 23;
                polyline.ColorIndex = 10;
IL_2E0:
                num2          = 24;
                this.entity_0 = CAD.AddEnt(polyline);
IL_2F0:
                num2 = 25;
                object  systemVariable = Application.GetSystemVariable("TARGET");
                Point3d point3d2;
                Point3d point3d = (systemVariable != null) ? ((Point3d)systemVariable) : point3d2;
IL_311:
                num2 = 26;
                maxPoint..ctor(maxPoint.X - point3d.X, maxPoint.Y - point3d.Y, maxPoint.Z - point3d.Z);
IL_348:
                num2 = 27;
                minPoint..ctor(minPoint.X - point3d.X, minPoint.Y - point3d.Y, minPoint.Z - point3d.Z);
IL_37F:
                num2 = 28;
                long                    val;
                long                    val2;
                ViewTableRecord         currentView;
                AbstractViewTableRecord abstractViewTableRecord;
                checked
                {
                    val = (long)Math.Round(unchecked (maxPoint.get_Coordinate(1) - minPoint.get_Coordinate(1)));
IL_39B:
                    num2 = 29;
                    val2 = (long)Math.Round(unchecked (maxPoint.get_Coordinate(0) - minPoint.get_Coordinate(0)));
IL_3B7:
                    num2        = 30;
                    currentView = this.editor_0.GetCurrentView();
IL_3C7:
                    num2 = 31;
                    abstractViewTableRecord = currentView;
                }
                point2d..ctor((maxPoint.get_Coordinate(0) + minPoint.get_Coordinate(0)) / 2.0, (minPoint.get_Coordinate(1) + maxPoint.get_Coordinate(1)) / 2.0);
                abstractViewTableRecord.CenterPoint = point2d;
IL_410:
                num2 = 32;
                object left = Math.Max(val2, val);
IL_423:
                num2 = 33;
                currentView.Height = Conversions.ToDouble(Operators.MultiplyObject(left, 2));
IL_43F:
                num2 = 34;
                currentView.Width = Conversions.ToDouble(Operators.MultiplyObject(left, 2));
IL_45B:
                num2 = 35;
                this.editor_0.SetCurrentView(currentView);
IL_46B:
                num2 = 36;
                Class36.smethod_60(Conversion.Str(num7));
IL_480:
                num2 = 37;
                this.TextBox3.Text = textString;
IL_490:
                num2 = 38;
                checked
                {
                    this.TextBox3.SelectionStart = (int)(num7 - 1L);
IL_4AB:
                    num2 = 39;
                    this.TextBox3.SelectionLength = Strings.Len(this.TextBox1.Text);
IL_4C9:
                    num2 = 40;
                    this.TextBox3.Focus();
IL_4D8:
                    num2       = 41;
                    this.int_0 = (int)(this.long_1 + 1L);
IL_4F2:
                    num2 = 45;
                    if (!(this.long_0 == 0L | this.long_1 >= this.long_0 - 1L))
                    {
                        goto IL_57D;
                    }
IL_524:
                    num2 = 46;
                    this.Button1.Enabled = false;
IL_533:
                    num2 = 47;
                    this.TextBox3.Text = "查无内容。";
IL_546:
                    num2 = 48;
                    this.Button1.Enabled = false;
IL_555:
                    num2 = 49;
                    this.Button2.Enabled = false;
IL_564:
                    num2 = 50;
                    this.Button3.Enabled = false;
IL_573:
                    num2       = 51;
                    this.int_0 = 0;
IL_57D:
                    num2 = 53;
                    documentLock.Dispose();
IL_586:
                    num2 = 54;
                    if (Information.Err().Number <= 0)
                    {
                        goto IL_5AD;
                    }
IL_598:
                    num2 = 55;
                    Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_5AD:
                    goto IL_6EB;
                    IL_5B2 :;
                }
                int num12 = num13 + 1;
                num13 = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num12);
IL_6A2:
                goto IL_6E0;
IL_6A4:
                num13 = num2;
                if (num <= -2)
                {
                    goto IL_5B2;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_6BD :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num13 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_6A4;
            }
IL_6E0:
            throw ProjectData.CreateProjectError(-2146828237);
IL_6EB:
            if (num13 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
コード例 #8
0
        public void TcJianTou()
        {
            this.point2dCollection_0 = new Point2dCollection();
            this.point3d_1           = CAD.GetPoint("选择插入点: ");
            Point3d point3d;

            if (!(this.point3d_1 == point3d))
            {
                Point2dCollection point2dCollection = this.point2dCollection_0;
                Point2d           point2d;
                point2d..ctor(this.point3d_1.X, this.point3d_1.Y);
                point2dCollection.Add(point2d);
                Polyline polyline = new Polyline();
                short    num;
                for (;;)
                {
                    num = checked ((short)(this.point2dCollection_0.Count - 1));
                    if (num >= 1)
                    {
                        Class36.smethod_64(polyline.ObjectId);
                        polyline = new Polyline();
                        polyline.SetDatabaseDefaults();
                        short num2 = 0;
                        short num3 = num;
                        short num4 = num2;
                        for (;;)
                        {
                            short num5 = num4;
                            short num6 = num3;
                            if (num5 > num6)
                            {
                                break;
                            }
                            polyline.AddVertexAt((int)num4, this.point2dCollection_0[(int)num4], 0.0, 0.0, 0.0);
                            num4 += 1;
                        }
                        CAD.AddEnt(polyline);
                    }
                    short num7 = this.GangJin();
                    if (num7 != 1)
                    {
                        break;
                    }
                    this.point3d_1 = this.point3d_2;
                    Point2dCollection point2dCollection2 = this.point2dCollection_0;
                    point2d..ctor(this.point3d_2.X, this.point3d_2.Y);
                    point2dCollection2.Add(point2d);
                }
                num = checked ((short)(this.point2dCollection_0.Count - 1));
                if (num >= 1)
                {
                    Class36.smethod_64(polyline.ObjectId);
                    polyline = new Polyline();
                    polyline.SetDatabaseDefaults();
                    short num8  = 0;
                    short num9  = num;
                    short num10 = num8;
                    for (;;)
                    {
                        short num11 = num10;
                        short num6  = num9;
                        if (num11 > num6)
                        {
                            break;
                        }
                        polyline.AddVertexAt((int)num10, this.point2dCollection_0[(int)num10], 0.0, 0.0, 0.0);
                        num10 += 1;
                    }
                    Point2d p        = this.point2dCollection_0[(int)num];
                    Point2d point2d2 = this.point2dCollection_0[(int)(checked (num - 1))];
                    double  angle    = p.GetVectorTo(point2d2).Angle;
                    double  num12    = p.GetDistanceTo(point2d2);
                    num12 = Math.Min(num12, 400.0);
                    Point2d point2dAngle = CAD.GetPoint2dAngle(p, num12, angle * 180.0 / 3.1415926535897931);
                    polyline.AddVertexAt((int)num, this.point2dCollection_0[(int)num], 0.0, 0.0, 90.0);
                    polyline.AddVertexAt((int)(checked (num + 1)), point2dAngle, 0.0, 90.0, 0.0);
                    CAD.AddEnt(polyline);
                }
            }
        }
コード例 #9
0
        public void 任意多边形填充()
        {
            int    num;
            int    num10;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Point3d[] array = new Point3d[2];
IL_12:
                num2 = 3;
                Class36.smethod_32(ref array[0], ref array[1], "选择插入点:");
IL_2D:
                num2 = 4;
                short num3 = 1;
IL_31:
                num2 = 5;
                Polyline polyline = new Polyline();
                for (;;)
                {
IL_124:
                    num2 = 6;
                    short    num4;
                    Polyline polyline2;
                    short    num6;
                    checked
                    {
                        num3 += 1;
IL_3F:
                        num2  = 7;
                        array = (Point3d[])Utils.CopyArray((Array)array, new Point3d[(int)(num3 + 1)]);
IL_5A:
                        num2 = 10;
                        num4 = Class36.smethod_29(array[(int)(num3 - 1)], ref array[(int)num3], "选择下一点: ");
IL_7E:
                        num2 = 11;
                        if (num4 == 0)
                        {
                            break;
                        }
IL_8B:
                        num2 = 14;
IL_8E:
                        num2      = 15;
                        polyline2 = new Polyline();
IL_98:
                        num2 = 16;
                        short num5 = 0;
                        num6 = (short)Information.UBound(array, 1);
                        num4 = num5;
                    }
                    for (;;)
                    {
                        short num7 = num4;
                        short num8 = num6;
                        if (num7 > num8)
                        {
                            break;
                        }
IL_AA:
                        num2 = 17;
                        polyline2.AddVertexAt((int)num4, Class36.smethod_38(array[(int)num4]), 0.0, 0.0, 0.0);
IL_E3:
                        num2  = 18;
                        num4 += 1;
                    }
IL_F7:
                    num2             = 19;
                    polyline2.Closed = true;
IL_102:
                    num2 = 20;
                    CAD.AddEnt(polyline2);
IL_10D:
                    num2 = 21;
                    Class36.smethod_64(polyline.ObjectId);
IL_11D:
                    num2     = 22;
                    polyline = polyline2;
                }
IL_130:
                num2 = 25;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_13F:
                num2 = 26;
                Database database = mdiActiveDocument.Database;
IL_14B:
                num2 = 27;
                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 = 500.0;
                    hatch.SetHatchPattern(1, "grass");
                    hatch.Associative = true;
                    hatch.AppendLoop(16, objectIdCollection);
                    hatch.EvaluateHatch(true);
                    transaction.Commit();
                }
IL_218:
                num2 = 29;
                Class36.smethod_64(polyline.ObjectId);
IL_228:
                num2 = 30;
                if (Information.Err().Number <= 0)
                {
                    goto IL_24F;
                }
IL_23A:
                num2 = 31;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_24F:
                goto IL_331;
IL_254:
                int num9 = num10 + 1;
                num10    = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num9);
IL_2E8:
                goto IL_326;
IL_2EA:
                num10 = num2;
                if (num <= -2)
                {
                    goto IL_254;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_303 :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num10 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_2EA;
            }
IL_326:
            throw ProjectData.CreateProjectError(-2146828237);
IL_331:
            if (num10 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
コード例 #10
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();
            }
        }
コード例 #11
0
        public void TcLXBZ()
        {
            int    num;
            int    num11;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Class36.smethod_78("Dim80", 80, 1.0, true);
IL_22:
                num2           = 3;
                this.point3d_0 = new Point3d[2];
IL_30:
                num2 = 6;
                ObjectId[] array = new ObjectId[2];
IL_3A:
                num2 = 7;
                ObjectId[] array2 = null;
IL_3F:
                num2 = 8;
                this.point3d_0[0] = CAD.GetPoint("选择插入点: ");
IL_5C:
                num2 = 9;
                Point3d point3d;
                if (!(this.point3d_0[0] == point3d))
                {
                    goto IL_7E;
                }
IL_79:
                goto IL_425;
IL_7E:
                num2 = 12;
IL_81:
                num2           = 13;
                this.point3d_2 = this.point3d_0[0];
IL_9B:
                num2         = 15;
                this.short_0 = 1;
IL_A5:
                num2 = 16;
                if (this.LineDimJig() != 1)
                {
                    goto IL_2CB;
                }
IL_B6:
                num2         = 17;
                this.short_0 = 2;
IL_C0:
                num2 = 18;
                this.LineDimJig();
                checked
                {
                    for (;;)
                    {
IL_2A4:
                        num2 = 23;
                        short num3 = (short)Information.UBound(this.point3d_0, 1);
IL_CF:
                        num2 = 24;
                        Class36.smethod_60(Conversions.ToString((int)num3));
IL_DF:
                        num2 = 25;
                        if (num3 == 0)
                        {
IL_E9:
                            num2 = 26;
                            num3 = 1;
                        }
IL_EF:
                        num2  = 28;
                        array = new ObjectId[(int)(num3 - 1 + 1)];
IL_FF:
                        num2 = 31;
                        int num4 = 0;
                        int num5 = (int)(num3 - 1);
                        int num6 = num4;
                        for (;;)
                        {
                            int num7 = num6;
                            int num8 = num5;
                            if (num7 > num8)
                            {
                                break;
                            }
IL_10D:
                            num2        = 32;
                            array[num6] = CAD.AddLineDim(this.point3d_0[num6], this.point3d_0[num6 + 1], this.point3d_1);
IL_14F:
                            num2 = 33;
                            num6++;
                        }
IL_162:
                        num2 = 34;
                        if (array2 != null)
                        {
IL_16F:
                            num2 = 35;
                            ObjectId[] array3 = array2;
                            int        i      = 0;
                            while (i < array3.Length)
                            {
                                ObjectId objectId = array3[i];
IL_192:
                                num2 = 36;
                                ObjectId objectId2;
                                if (objectId != objectId2)
                                {
IL_19E:
                                    num2 = 37;
                                    Class36.smethod_64(objectId);
                                }
                                i++;
IL_1AE:
                                num2 = 39;
                            }
                        }
IL_1B3:
                        num2   = 41;
                        array2 = array;
IL_1BA:
                        num2 = 42;
                        int num9 = Information.UBound(this.point3d_0, 1);
IL_1CB:
                        num2           = 43;
                        this.point3d_0 = (Point3d[])Utils.CopyArray((Array)this.point3d_0, new Point3d[num9 + 1 + 1]);
IL_1F4:
                        num2 = 46;
                        int num10 = (int)Class36.smethod_29(this.point3d_0[num9], ref this.point3d_0[num9 + 1], "选择下一点: ");
IL_224:
                        num2 = 47;
                        this.point3d_0[num9 + 1] = Class36.smethod_62(this.point3d_0[num9 + 1], this.point3d_0[0], this.point3d_0[1]);
IL_276:
                        num2 = 48;
                        Class36.smethod_47(ref this.point3d_0);
IL_285:
                        num2 = 49;
                        if (Information.Err().Number > 0)
                        {
                            break;
                        }
IL_297:
                        num2 = 52;
                        if (num10 == 0)
                        {
                            break;
                        }
IL_2A1:
                        num2 = 55;
                    }
IL_2BB:
                    num2 = 58;
                    Class36.smethod_55(array);
IL_2C6:
                    goto IL_425;
IL_2CB:
                    num2 = 20;
IL_2CE:
                    goto IL_425;
IL_2D3:
                    goto IL_41A;
IL_2D8:
                    num11 = num2;
                    if (num <= -2)
                    {
                        goto IL_2F3;
                    }
                    @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                    goto IL_3F4;
                    IL_2F3 :;
                }
                int num12 = num11 + 1;
                num11 = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num12);
                IL_3F4 :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num11 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_2D8;
            }
IL_41A:
            throw ProjectData.CreateProjectError(-2146828237);
IL_425:
            if (num11 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
コード例 #12
0
ファイル: TcBJFJ_frm.cs プロジェクト: 1833183060/autocad-dev
        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();
            }
        }
コード例 #13
0
        public void TcJianTuDuiBi()
        {
            int    num;
            int    num5;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                Polyline polyline = (Polyline)Class36.smethod_72("选择原配筋简图边框:");
IL_1C:
                num2 = 3;
                Class36.smethod_73(polyline.ObjectId);
IL_2A:
                num2 = 4;
                Polyline polyline2 = (Polyline)Class36.smethod_72("选择新配筋简图边框:");
IL_3D:
                num2 = 5;
                Class36.smethod_73(polyline2.ObjectId);
IL_4B:
                num2 = 6;
                Point3d  minPoint = polyline.GeometricExtents.MinPoint;
                Vector3d vectorTo = minPoint.GetVectorTo(polyline2.GeometricExtents.MinPoint);
IL_78:
                num2 = 7;
                Point3dCollection point3dCollection = new Point3dCollection();
IL_81:
                num2 = 8;
                Point3d minPoint2 = polyline.GeometricExtents.MinPoint;
IL_95:
                num2 = 9;
                Point3d maxPoint = polyline.GeometricExtents.MaxPoint;
IL_AA:
                num2 = 10;
                point3dCollection.Add(minPoint2);
IL_B7:
                num2 = 11;
                Point3dCollection point3dCollection2 = point3dCollection;
                minPoint..ctor(minPoint2.X, maxPoint.Y, minPoint2.Z);
                point3dCollection2.Add(minPoint);
IL_E0:
                num2 = 12;
                point3dCollection.Add(maxPoint);
IL_ED:
                num2 = 13;
                Point3dCollection point3dCollection3 = point3dCollection;
                minPoint..ctor(maxPoint.X, minPoint2.Y, minPoint2.Z);
                point3dCollection3.Add(minPoint);
IL_116:
                num2 = 14;
                TypedValue[] array = new TypedValue[1];
IL_120:
                num2 = 15;
                Array      array2 = array;
                TypedValue typedValue;
                typedValue..ctor(0, "TEXT");
                array2.SetValue(typedValue, 0);
IL_13D:
                num2 = 16;
                DBObjectCollection dbobjectCollection = 结构分析.WindowPolygon(point3dCollection, array);
IL_14A:
                num2 = 17;
                IEnumerator enumerator = dbobjectCollection.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    DBText dbtext = (DBText)enumerator.Current;
IL_170:
                    num2 = 18;
                    Application.DoEvents();
IL_178:
                    num2 = 19;
                    TypedValue[] array3 = new TypedValue[2];
IL_183:
                    num2 = 20;
                    Array array4 = array3;
                    typedValue..ctor(0, "TEXT");
                    array4.SetValue(typedValue, 0);
IL_1A1:
                    num2 = 21;
                    Array array5 = array3;
                    typedValue..ctor(8, dbtext.Layer);
                    array5.SetValue(typedValue, 1);
IL_1C1:
                    num2 = 22;
                    Point3d entCenter = CAD.GetEntCenter(dbtext);
IL_1CD:
                    num2 = 23;
                    entCenter..ctor(entCenter.X + vectorTo.X, entCenter.Y + vectorTo.Y, entCenter.Z + vectorTo.Z);
IL_204:
                    num2 = 24;
                    Point3dCollection point3dCollection4 = new Point3dCollection();
IL_20E:
                    num2 = 25;
                    double num3 = dbtext.Height / 3.0;
IL_224:
                    num2 = 26;
                    Point3dCollection point3dCollection5 = point3dCollection4;
                    minPoint..ctor(entCenter.X - num3, entCenter.Y - num3, entCenter.Z);
                    point3dCollection5.Add(minPoint);
IL_253:
                    num2 = 27;
                    Point3dCollection point3dCollection6 = point3dCollection4;
                    minPoint..ctor(entCenter.X - num3, entCenter.Y + num3, entCenter.Z);
                    point3dCollection6.Add(minPoint);
IL_282:
                    num2 = 28;
                    Point3dCollection point3dCollection7 = point3dCollection4;
                    minPoint..ctor(entCenter.X + num3, entCenter.Y + num3, entCenter.Z);
                    point3dCollection7.Add(minPoint);
IL_2B1:
                    num2 = 29;
                    Point3dCollection point3dCollection8 = point3dCollection4;
                    minPoint..ctor(entCenter.X + num3, entCenter.Y - num3, entCenter.Z);
                    point3dCollection8.Add(minPoint);
IL_2E0:
                    num2 = 30;
                    DBObjectCollection dbobjectCollection2 = 结构分析.CrossingPolygon(point3dCollection4, array3);
IL_2EE:
                    num2 = 31;
                    ObjectId objectId = dbobjectCollection2[0].ObjectId;
IL_300:
                    num2 = 32;
                    string textString = dbtext.TextString;
IL_30C:
                    num2 = 33;
                    string txt = this.GetTxt(objectId);
IL_319:
                    num2 = 34;
                    if (Operators.CompareString(textString, txt, false) == 0)
                    {
IL_32B:
                        num2 = 35;
                        Class36.smethod_64(objectId);
                    }
                    else
                    {
IL_338:
                        num2 = 37;
IL_33B:
                        num2 = 38;
                        bool flag = this.StrBiJiao(textString, txt);
IL_34A:
                        num2 = 39;
                        if (!flag)
                        {
IL_354:
                            num2 = 40;
                            this.method_1(objectId);
                        }
                        else
                        {
IL_362:
                            num2 = 42;
IL_365:
                            num2 = 43;
                            this.method_0(objectId);
                        }
                    }
IL_371:
                    num2 = 46;
                }
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
IL_394:
                num2 = 47;
                Class36.smethod_74(polyline.ObjectId);
IL_3A3:
                num2 = 48;
                Class36.smethod_74(polyline2.ObjectId);
IL_3B2:
                num2 = 49;
                Interaction.MsgBox("简图对比完毕!", MsgBoxStyle.OkOnly, null);
IL_3C2:
                goto IL_4E8;
IL_3C7:
                int num4 = num5 + 1;
                num5     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num4);
IL_49F:
                goto IL_4DD;
IL_4A1:
                num5 = num2;
                if (num <= -2)
                {
                    goto IL_3C7;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_4BA :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num5 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_4A1;
            }
IL_4DD:
            throw ProjectData.CreateProjectError(-2146828237);
IL_4E8:
            if (num5 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }
コード例 #14
0
ファイル: 打砖块.cs プロジェクト: 1833183060/autocad-dev
        public void Zhuangji()
        {
            try
            {
                foreach (object obj in this.dbobjectCollection_0)
                {
                    Polyline polyline = (Polyline)obj;
                    this.point3dCollection_0 = new Point3dCollection();
                    polyline.IntersectWith(this.circle_0, 0, new Plane(), this.point3dCollection_0, IntPtr.Zero, IntPtr.Zero);
                    if (this.point3dCollection_0.Count > 0)
                    {
                        Class36.smethod_64(polyline.ObjectId);
                        this.dbobjectCollection_0.Remove(polyline);
                        checked
                        {
                            this.long_2 += 100L;
                        }
                        this.double_3 = 6.2831853071795862 - this.double_3;
                    }
                }
            }
            finally
            {
                IEnumerator enumerator;
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            this.point3dCollection_0 = new Point3dCollection();
            this.polyline_0.IntersectWith(this.circle_0, 0, new Plane(), this.point3dCollection_0, IntPtr.Zero, IntPtr.Zero);
            if (this.point3dCollection_0.Count > 0)
            {
                this.double_3 = 6.2831853071795862 - this.double_3;
            }
            Point3d pointXY  = CAD.GetPointXY(this.circle_0.Center, 0.0, this.double_2);
            Point3d pointXY2 = CAD.GetPointXY(this.circle_0.Center, 0.0, -this.double_2);
            Point3d pointXY3 = CAD.GetPointXY(this.circle_0.Center, -this.double_2, 0.0);
            Point3d pointXY4 = CAD.GetPointXY(this.circle_0.Center, this.double_2, 0.0);

            if (pointXY.Y >= this.point3d_1.Y)
            {
                this.double_3 = 6.2831853071795862 - this.double_3;
            }
            checked
            {
                if (pointXY2.Y <= this.point3d_4.Y)
                {
                    this.long_0 += 1L;
                    if (this.long_0 == 1L)
                    {
                        Class36.smethod_64(this.objectId_1);
                        Class36.smethod_64(this.circle_0.ObjectId);
                        this.circle_0 = this.circle_1;
                        CAD.EntMove(this.circle_0.Id, this.circle_0.Center, CAD.GetPointAR_Radian(this.point3d_0, this.double_3, this.double_2));
                    }
                    else
                    {
                        if (this.long_0 != 2L)
                        {
                            ObjectId id = Class36.smethod_57("Game Over", this.point3d_0, this.double_0 / 5.0, 4, 2, "STANDARD", 0.0);
                            CAD.ChangeLayer(id, "打砖块-墙");
                            this.editor_0.WriteMessage("\r\n停止");
                            this.editor_0.PointMonitor -= new PointMonitorEventHandler(this.GetMousePoint);
                            this.timer_0.Tick          -= this.timer1_Tick;
                            this.timer_1.Tick          -= this.timer2_Tick;
                            return;
                        }
                        Class36.smethod_64(this.objectId_2);
                        Class36.smethod_64(this.circle_0.ObjectId);
                        this.circle_0 = this.circle_2;
                        CAD.EntMove(this.circle_0.Id, this.circle_0.Center, CAD.GetPointAR_Radian(this.point3d_0, this.double_3, this.double_2));
                    }
                }
            }
            if (pointXY3.X <= this.point3d_2.X)
            {
                this.double_3 = 9.42477796076938 - this.double_3;
            }
            if (pointXY4.X >= this.point3d_1.X)
            {
                this.double_3 = 9.42477796076938 - this.double_3;
            }
        }
コード例 #15
0
        public void TcDuanMianByLine1()
        {
            Entity   entity            = null;
            Entity   e                 = null;
            Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
            Database database          = mdiActiveDocument.Database;
            Point3d  entCenter;
            Line     line;
            string   text;

            checked
            {
                Point3d entCenter2;
                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)
                    {
                        return;
                    }
                    SelectionSet value = selection.Value;
                    if (value.Count < 1)
                    {
                        return;
                    }
                    if (value.Count > 2)
                    {
                        entity = (Entity)transaction.GetObject(value[0].ObjectId, 0);
                        e      = (Entity)transaction.GetObject(value[value.Count - 1].ObjectId, 0);
                    }
                    else if (value.Count == 2)
                    {
                        entity = (Entity)transaction.GetObject(value[0].ObjectId, 0);
                        e      = (Entity)transaction.GetObject(value[1].ObjectId, 0);
                    }
                    entCenter  = CAD.GetEntCenter(entity);
                    entCenter2 = CAD.GetEntCenter(e);
                    transaction.Commit();
                }
                line = CAD.AddLine(entCenter, entCenter2, "0");
                text = Interaction.InputBox("直接距离" + Conversions.ToString((long)Math.Round(line.Length)) + ",请输入分布的钢筋根数", "", "2", -1, -1);
            }
            if (Operators.CompareString(text, "", false) == 0)
            {
                Class36.smethod_64(line.ObjectId);
            }
            else
            {
                double num  = line.Length / (Conversions.ToDouble(text) + 1.0);
                short  num2 = 1;
                short  num3 = Conversions.ToShort(text);
                short  num4 = num2;
                for (;;)
                {
                    short num5 = num4;
                    short num6 = num3;
                    if (num5 > num6)
                    {
                        break;
                    }
                    Point3d pointAtDist = line.GetPointAtDist(num * (double)num4);
                    CAD.EntCopy(entity, entCenter, pointAtDist);
                    num4 += 1;
                }
                Class36.smethod_64(line.ObjectId);
            }
        }