protected override SamplerStatus Sampler(JigPrompts Prompts)
        {
            PromptPointResult promptPointResult = Prompts.AcquirePoint(new JigPromptPointOptions("\r\n请指定下一点:")
            {
                Cursor       = 6,
                BasePoint    = this.point3d_0,
                UseBasePoint = true
            });
            Point3d       value = promptPointResult.Value;
            SamplerStatus result;

            if (value != this.point3d_1)
            {
                Point3d point3d  = Class36.smethod_46(this.point3d_0, value);
                Point3d point3d2 = Class36.smethod_46(this.point3d_0, point3d);
                Point3d point3d3 = Class36.smethod_46(value, point3d);
                double  num      = value.GetVectorTo(this.point3d_0).AngleOnPlane(new Plane());
                double  num2     = 0.6 * this.point3d_0.DistanceTo(value);
                double  num3     = Math.Atan(1.0) * 4.0;
                Point3d point3d4;
                point3d4..ctor(point3d2.get_Coordinate(0) + Math.Cos(num + num3 / 2.0) * num2, point3d2.get_Coordinate(1) + Math.Sin(num + num3 / 2.0) * num2, point3d2.get_Coordinate(2));
                double num4   = point3d4.GetVectorTo(point3d).AngleOnPlane(new Plane());
                double num5   = point3d4.GetVectorTo(this.point3d_0).AngleOnPlane(new Plane());
                object value2 = point3d4.DistanceTo(point3d);
                this.entity_0[0] = new Arc(point3d4, Conversions.ToDouble(value2), num4, num5);
                point3d4..ctor(point3d3.get_Coordinate(0) + Math.Cos(num + num3 / 2.0) * num2, point3d3.get_Coordinate(1) + Math.Sin(num + num3 / 2.0) * num2, point3d3.get_Coordinate(2));
                num4             = point3d4.GetVectorTo(value).AngleOnPlane(new Plane());
                num5             = point3d4.GetVectorTo(point3d).AngleOnPlane(new Plane());
                this.entity_0[1] = new Arc(point3d4, Conversions.ToDouble(value2), num4, num5);
                point3d4..ctor(point3d3.get_Coordinate(0) + Math.Cos(num - num3 / 2.0) * num2, point3d3.get_Coordinate(1) + Math.Sin(num - num3 / 2.0) * num2, point3d3.get_Coordinate(2));
                num4             = point3d4.GetVectorTo(point3d).AngleOnPlane(new Plane());
                num5             = point3d4.GetVectorTo(value).AngleOnPlane(new Plane());
                this.entity_0[2] = new Arc(point3d4, Conversions.ToDouble(value2), num4, num5);
                this.point3d_1   = value;
                result           = 0;
            }
            else
            {
                result = 1;
            }
            return(result);
        }
        protected override SamplerStatus Sampler(JigPrompts Prompts)
        {
            PromptPointResult promptPointResult = Prompts.AcquirePoint(new JigPromptPointOptions("\r\n请指定下一点:")
            {
                Cursor       = 6,
                BasePoint    = this.point3d_0,
                UseBasePoint = true
            });
            Point3d       value = promptPointResult.Value;
            SamplerStatus result;

            if (value != this.point3d_1)
            {
                double  num  = this.point3d_0.DistanceTo(value) * 2.0;
                double  num2 = this.point3d_0.GetVectorTo(value).AngleOnPlane(new Plane()) * 180.0 / 3.1415926;
                Point3d p    = Class36.smethod_46(this.point3d_0, value);
                if (num >= 50.0 * this.double_0)
                {
                    num = 50.0 * this.double_0;
                }
                this.entity_0[0] = new Line(CAD.GetPointAngle(this.point3d_0, 1.4142 * num, num2 + 135.0), CAD.GetPointAngle(p, 1.3485 * num, num2 + 132.1352));
                this.entity_0[1] = new Line(CAD.GetPointAngle(value, 1.4142 * num, num2 + 45.0), CAD.GetPointAngle(p, 1.6421 * num, num2 + 37.5152));
                this.entity_0[2] = new Line(CAD.GetPointAngle(this.point3d_0, 1.4142 * num, num2 - 135.0), CAD.GetPointAngle(p, 1.6421 * num, num2 - 142.4848));
                this.entity_0[3] = new Line(CAD.GetPointAngle(value, 1.4142 * num, num2 - 45.0), CAD.GetPointAngle(p, 1.3485 * num, num2 - 47.8648));
                this.entity_0[4] = new Line(CAD.GetPointAngle(p, 1.6421 * num, num2 - 142.4848), CAD.GetPointAngle(p, 2.8284 * num, num2 + 101.25));
                this.entity_0[5] = new Line(CAD.GetPointAngle(p, 2.8284 * num, num2 + 101.25), CAD.GetPointAngle(p, 2.8284 * num, num2 - 78.75));
                this.entity_0[6] = new Line(CAD.GetPointAngle(p, 2.8284 * num, num2 - 78.75), CAD.GetPointAngle(p, 1.6421 * num, num2 + 37.5152));
                this.point3d_1   = value;
                result           = 0;
            }
            else
            {
                result = 1;
            }
            return(result);
        }
Exemple #3
0
        public void TcLJM()
        {
            LJM_Frm ljm_Frm = new LJM_Frm();

            ljm_Frm.ShowDialog();
            checked
            {
                if (ljm_Frm.DialogResult == DialogResult.OK)
                {
                    string text = ljm_Frm.TextBox1.Text;
                    text = text.Replace("\\", "/");
                    text = text.Replace(" ", "/");
                    text = text.Replace(",", "/");
                    text = text.Replace(",", "/");
                    text = text.Replace("、", "/");
                    int     num   = Strings.InStr(text, "/", CompareMethod.Binary);
                    long    num2  = (long)Math.Round(unchecked (Conversion.Val(text.Substring(0, checked (num - 1))) * 5.0));
                    long    num3  = (long)Math.Round(unchecked (Conversion.Val(text.Substring(num, checked (text.Length - num))) * 5.0));
                    Point3d point = CAD.GetPoint("选择插入点: ");
                    Point3d point3d;
                    if (!(point == point3d))
                    {
                        Point3d pointXY     = CAD.GetPointXY(point, (double)num2 / 2.0, (double)num3 / 2.0);
                        Point3d pointXY2    = CAD.GetPointXY(point, (double)(0L - num2) / 2.0, (double)num3 / 2.0);
                        Point3d pointXY3    = CAD.GetPointXY(point, (double)(0L - num2) / 2.0, (double)(0L - num3) / 2.0);
                        Point3d pointXY4    = CAD.GetPointXY(point, (double)num2 / 2.0, (double)(0L - num3) / 2.0);
                        Point3d pointAngle  = CAD.GetPointAngle(pointXY, 250.0, -135.0);
                        Point3d point3d2    = CAD.GetPointAngle(pointXY2, 250.0, -45.0);
                        Point3d pointAngle2 = CAD.GetPointAngle(pointXY3, 250.0, 45.0);
                        Point3d pointAngle3 = CAD.GetPointAngle(pointXY4, 250.0, 135.0);
                        Point3d pointXY5    = CAD.GetPointXY(point, (double)(0L - num2) / 2.0, (double)(0L - num3) / 2.0);
                        CAD.AddPlinePxy(pointXY5, (double)num2, (double)num3, 0.0, "");
                        text = JG.ReplaceGJ(ljm_Frm.TextBox2.Text);
                        num  = NF.InStr_N(text, "/");
                        Point3d[] array;
                        Point3d[] array2;
                        if (num == 1)
                        {
                            short num4 = (short)Strings.InStr(text, "/", CompareMethod.Binary);
                            short num5 = (short)Math.Round(Conversion.Val(text.Substring((int)(num4 - 9), 1)));
                            short num6 = (short)Math.Round(Conversion.Val(text.Substring((int)num4, 1)));
                            array    = new Point3d[(int)(unchecked (num5 + num6) - 1 + 1)];
                            array2   = new Point3d[(int)(num5 - 3 + 1)];
                            array[0] = point3d2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(unchecked (num5 + num6) - 1)] = pointAngle;
                            Class36.smethod_16(array[(int)(unchecked (num5 + num6) - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num5 - 2 + 1));
                            short num7 = 1;
                            short num8 = num5 - 2;
                            num4 = num7;
                            for (;;)
                            {
                                short num9  = num4;
                                short num10 = num8;
                                if (num9 > num10)
                                {
                                    break;
                                }
                                array[(int)num4] = CAD.GetPointXY(array[0], (double)(num * (int)num4), 0.0);
                                Class36.smethod_16(array[(int)num4], 50.0, "墙柱纵筋");
                                array2[(int)(num4 - 1)] = array[(int)num4];
                                unchecked
                                {
                                    num4 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num6 - 1));
                            short num11 = num5;
                            short num12 = unchecked (num5 + num6) - 1;
                            num4 = num11;
                            for (;;)
                            {
                                short num13 = num4;
                                short num10 = num12;
                                if (num13 > num10)
                                {
                                    break;
                                }
                                array[(int)num4] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num4 - num5))), -150.0);
                                Class36.smethod_16(array[(int)num4], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num4 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 1, 100.0);
                        }
                        else if (num == 2)
                        {
                            short num14 = (short)Strings.InStr(text, "/", CompareMethod.Binary);
                            short num15 = (short)Math.Round(Conversion.Val(text.Substring((int)(num14 - 9), 1)));
                            short num16 = (short)Math.Round(Conversion.Val(text.Substring((int)num14, 1)));
                            short num17 = (short)Math.Round(Conversion.Val(text.Substring((int)(num14 + 9), 1)));
                            array    = new Point3d[(int)(unchecked (num15 + num16 + num17) - 1 + 1)];
                            array2   = new Point3d[(int)(num15 - 3 + 1)];
                            array[0] = point3d2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(unchecked (num15 + num16 + num17) - 1)] = pointAngle;
                            Class36.smethod_16(array[(int)(unchecked (num15 + num16 + num17) - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num15 - 2 + 1));
                            short num18 = 1;
                            short num19 = num15 - 2;
                            num14 = num18;
                            for (;;)
                            {
                                short num20 = num14;
                                short num10 = num19;
                                if (num20 > num10)
                                {
                                    break;
                                }
                                array[(int)num14] = CAD.GetPointXY(array[0], (double)(num * (int)num14), 0.0);
                                Class36.smethod_16(array[(int)num14], 50.0, "墙柱纵筋");
                                array2[(int)(num14 - 1)] = array[(int)num14];
                                unchecked
                                {
                                    num14 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num16 - 1));
                            short num21 = num15;
                            short num22 = unchecked (num15 + num16) - 1;
                            num14 = num21;
                            for (;;)
                            {
                                short num23 = num14;
                                short num10 = num22;
                                if (num23 > num10)
                                {
                                    break;
                                }
                                array[(int)num14] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num14 - num15))), -150.0);
                                Class36.smethod_16(array[(int)num14], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num14 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num17 - 1));
                            short num24 = unchecked (num15 + num16);
                            short num25 = unchecked (num15 + num16 + num17) - 1;
                            num14 = num24;
                            for (;;)
                            {
                                short num26 = num14;
                                short num10 = num25;
                                if (num26 > num10)
                                {
                                    break;
                                }
                                array[(int)num14] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num14 - num15 - num16))), -300.0);
                                Class36.smethod_16(array[(int)num14], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num14 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 1, 100.0);
                        }
                        else
                        {
                            short num27 = (short)Strings.InStr(text, "+", CompareMethod.Binary);
                            short num28;
                            if (num27 > 0)
                            {
                                num28 = (short)Math.Round(unchecked (Conversion.Val(text.Substring((int)(checked (num27 - 9)), 1)) + Conversion.Val(text.Substring((int)num27, 1))));
                            }
                            else
                            {
                                num28 = (short)Math.Round(Conversion.Val(text.Substring(0, 1)));
                            }
                            array    = new Point3d[(int)(num28 - 1 + 1)];
                            array2   = new Point3d[(int)(num28 - 3 + 1)];
                            array[0] = point3d2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(num28 - 1)] = pointAngle;
                            Class36.smethod_16(array[(int)(num28 - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num28 - 2 + 1));
                            short num29 = 1;
                            short num30 = num28 - 2;
                            num27 = num29;
                            for (;;)
                            {
                                short num31 = num27;
                                short num10 = num30;
                                if (num31 > num10)
                                {
                                    break;
                                }
                                array[(int)num27] = CAD.GetPointXY(array[0], (double)(num * (int)num27), 0.0);
                                Class36.smethod_16(array[(int)num27], 50.0, "墙柱纵筋");
                                array2[(int)(num27 - 1)] = array[(int)num27];
                                unchecked
                                {
                                    num27 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 1, 100.0);
                        }
                        text = JG.ReplaceGJ(ljm_Frm.TextBox3.Text);
                        num  = NF.InStr_N(text, "/");
                        if (num == 1)
                        {
                            short num32 = (short)Strings.InStr(text, "/", CompareMethod.Binary);
                            short num33 = (short)Math.Round(Conversion.Val(text.Substring((int)(num32 - 9), 1)));
                            short num34 = (short)Math.Round(Conversion.Val(text.Substring((int)num32, 1)));
                            array    = new Point3d[(int)(unchecked (num34 + num33) - 1 + 1)];
                            array[0] = pointAngle2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(unchecked (num34 + num33) - 1)] = pointAngle3;
                            Class36.smethod_16(array[(int)(unchecked (num34 + num33) - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num34 - 2 + 1));
                            short num35 = 1;
                            short num36 = num34 - 2;
                            num32 = num35;
                            for (;;)
                            {
                                short num37 = num32;
                                short num10 = num36;
                                if (num37 > num10)
                                {
                                    break;
                                }
                                array[(int)num32] = CAD.GetPointXY(array[0], (double)(num * (int)num32), 0.0);
                                Class36.smethod_16(array[(int)num32], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num32 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num33 - 1));
                            short num38 = num34;
                            short num39 = unchecked (num34 + num33) - 1;
                            num32 = num38;
                            for (;;)
                            {
                                short num40 = num32;
                                short num10 = num39;
                                if (num40 > num10)
                                {
                                    break;
                                }
                                array[(int)num32] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num32 - num34))), 150.0);
                                Class36.smethod_16(array[(int)num32], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num32 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 4, 100.0);
                        }
                        else if (num == 2)
                        {
                            short num41 = (short)Strings.InStr(text, "/", CompareMethod.Binary);
                            short num42 = (short)Math.Round(Conversion.Val(text.Substring((int)(num41 - 9), 1)));
                            short num43 = (short)Math.Round(Conversion.Val(text.Substring((int)num41, 1)));
                            short num44 = (short)Math.Round(Conversion.Val(text.Substring((int)(num41 + 9), 1)));
                            array    = new Point3d[(int)(unchecked (num44 + num43 + num42) - 1 + 1)];
                            array[0] = pointAngle2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(unchecked (num44 + num43 + num42) - 1)] = pointAngle3;
                            Class36.smethod_16(array[(int)(unchecked (num44 + num43 + num42) - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num44 - 2 + 1));
                            short num45 = 1;
                            short num46 = num44 - 2;
                            num41 = num45;
                            for (;;)
                            {
                                short num47 = num41;
                                short num10 = num46;
                                if (num47 > num10)
                                {
                                    break;
                                }
                                array[(int)num41] = CAD.GetPointXY(array[0], (double)(num * (int)num41), 0.0);
                                Class36.smethod_16(array[(int)num41], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num41 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num43 - 1));
                            short num48 = num44;
                            short num49 = unchecked (num44 + num43) - 1;
                            num41 = num48;
                            for (;;)
                            {
                                short num50 = num41;
                                short num10 = num49;
                                if (num50 > num10)
                                {
                                    break;
                                }
                                array[(int)num41] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num41 - num44))), 150.0);
                                Class36.smethod_16(array[(int)num41], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num41 += 1;
                                }
                            }
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num42 - 1));
                            short num51 = unchecked (num44 + num43);
                            short num52 = unchecked (num44 + num43 + num42) - 1;
                            num41 = num51;
                            for (;;)
                            {
                                short num53 = num41;
                                short num10 = num52;
                                if (num53 > num10)
                                {
                                    break;
                                }
                                array[(int)num41] = CAD.GetPointXY(array[0], (double)(num * (int)(unchecked (num41 - num44 - num43))), 300.0);
                                Class36.smethod_16(array[(int)num41], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num41 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 4, 100.0);
                        }
                        else
                        {
                            short num54 = (short)Strings.InStr(text, "+", CompareMethod.Binary);
                            short num55;
                            if (num54 > 0)
                            {
                                num55 = (short)Math.Round(unchecked (Conversion.Val(text.Substring((int)(checked (num54 - 9)), 1)) + Conversion.Val(text.Substring((int)num54, 1))));
                            }
                            else
                            {
                                num55 = (short)Math.Round(Conversion.Val(text.Substring(0, 1)));
                            }
                            array    = new Point3d[(int)(num55 - 1 + 1)];
                            array[0] = pointAngle2;
                            Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                            array[(int)(num55 - 1)] = pointAngle3;
                            Class36.smethod_16(array[(int)(num55 - 1)], 50.0, "墙柱纵筋");
                            num = (int)Math.Round((double)(num2 - 354L) / (double)(num55 - 2 + 1));
                            short num56 = 1;
                            short num57 = num55 - 2;
                            num54 = num56;
                            for (;;)
                            {
                                short num58 = num54;
                                short num10 = num57;
                                if (num58 > num10)
                                {
                                    break;
                                }
                                array[(int)num54] = CAD.GetPointXY(array[0], (double)(num * (int)num54), 0.0);
                                Class36.smethod_16(array[(int)num54], 50.0, "墙柱纵筋");
                                unchecked
                                {
                                    num54 += 1;
                                }
                            }
                            Class36.smethod_83(array, 500L, text, 4, 100.0);
                        }
                        object   obj          = CAD.CreateTextStyle("Tc_尺寸标注", "txt.shx", "hztxt.Shx", 0.7);
                        string   dimStyleName = "Tc_Dim100";
                        object   obj2         = obj;
                        ObjectId objectId;
                        ObjectId dimID = CAD.CreateDimStyle(dimStyleName, (obj2 != null) ? ((ObjectId)obj2) : objectId, 100, 1.0, false, -1.0);
                        unchecked
                        {
                            pointXY5 = CAD.GetPointXY(point, (double)(checked (0L - num2)) / 2.0 - 500.0, 0.0);
                            CAD.AddLineDim(pointXY2, pointXY3, pointXY5, 0.2, dimID, -1.0);
                            pointXY5 = CAD.GetPointXY(point, 0.0, (double)(checked (0L - num3)) / 2.0 - 1000.0);
                            CAD.AddLineDim(pointXY3, pointXY4, pointXY5, 0.2, dimID, -1.0);
                            string string_;
                            if (Conversions.ToDouble(ljm_Frm.TextBox7.Text) == 0.0)
                            {
                                string_ = "%%p0.000";
                            }
                            else
                            {
                                string_ = ljm_Frm.TextBox7.Text;
                            }
                            if (Operators.CompareString(ljm_Frm.Button1.Text, "顶部标高", false) == 0)
                            {
                                pointXY5 = CAD.GetPointXY(point, (double)(checked (0L - num2)) / 2.0 - 650.0, (double)num3 / 2.0);
                                Class36.smethod_81(pointXY5, 2, 1.0);
                                pointXY5 = CAD.GetPointXY(pointXY5, -300.0, 350.0);
                                Class36.smethod_57(string_, pointXY5, 300.0, 2, 0, "STANDARD", 0.0);
                            }
                            else
                            {
                                pointXY5 = CAD.GetPointXY(point, (double)(checked (0L - num2)) / 2.0 - 650.0, (double)(checked (0L - num3)) / 2.0);
                                Class36.smethod_81(pointXY5, 3, 1.0);
                                pointXY5 = CAD.GetPointXY(pointXY5, -300.0, -350.0);
                                Class36.smethod_57(string_, pointXY5, 300.0, 2, 3, "STANDARD", 0.0);
                            }
                        }
                        if (Operators.CompareString(ljm_Frm.TextBox5.Text, "", false) != 0)
                        {
                            text = JG.ReplaceGJ(ljm_Frm.TextBox5.Text);
                            num  = (int)Math.Round(Conversion.Val(text.Substring(0, 1)));
                            if (num % 2 == 0)
                            {
                                num  = (int)Math.Round((double)num / 2.0);
                                text = Conversions.ToString(2) + text.Substring(1, text.Length - 1);
                                short num59 = 0;
                                short num60 = (short)(num - 1);
                                short num61 = num59;
                                unchecked
                                {
                                    for (;;)
                                    {
                                        short num62 = num61;
                                        short num10 = num60;
                                        if (num62 > num10)
                                        {
                                            break;
                                        }
                                        array    = new Point3d[3];
                                        array[0] = CAD.GetPointXY(pointAngle2, 0.0, checked ((double)(num3 - 354L) / (double)(num + 1)) * (double)(checked (num61 + 1)));
                                        Class36.smethod_16(array[0], 50.0, "墙柱纵筋");
                                        array[2] = CAD.GetPointXY(pointAngle3, 0.0, checked ((double)(num3 - 354L) / (double)(num + 1)) * (double)(checked (num61 + 1)));
                                        Class36.smethod_16(array[2], 50.0, "墙柱纵筋");
                                        Class36.smethod_7(array[0], array[2]);
                                        array[1] = Class36.smethod_46(array[0], array[2]);
                                        array[1] = CAD.GetPointXY(array[1], 0.0, 74.0);
                                        Class36.smethod_83(array, 300L, text, 1, 100.0);
                                        num61 += 1;
                                    }
                                }
                            }
                        }
                        else
                        {
                            num = 2;
                        }
                        pointAngle = CAD.GetPointAngle(pointXY2, 100.0, -45.0);
                        point3d2   = CAD.GetPointAngle(pointXY4, 100.0, 135.0);
                        Class36.smethod_9(pointAngle, point3d2);
                        array = new Point3d[]
                        {
                            CAD.GetPointXY(point3d2, 0.0, (double)(num3 - 354L) / unchecked ((double)num / 2.0 + 1.0) / 2.0)
                        };
                        text = JG.ReplaceGJ(ljm_Frm.TextBox4.Text);
                        Class36.smethod_83(array, 0L, text, 1, 100.0);
                        num = Strings.InStr(text, "(", CompareMethod.Binary);
                        if (num != 0)
                        {
                            short num63 = Conversions.ToShort(text.Substring(num, 1));
                            if (num63 == 3)
                            {
                                Class36.smethod_7(array2[0], CAD.GetPointXY(array2[0], 0.0, (double)(0L - num3 + 354L)));
                            }
                            else if (num63 == 4)
                            {
                                pointAngle = CAD.GetPointAngle(array2[0], 150.0, 135.0);
                                point3d2   = CAD.GetPointXY(array2[0], unchecked (array2[1].X - array2[0].X), (double)(0L - num3 + 354L));
                                point3d2   = CAD.GetPointAngle(point3d2, 150.0, -45.0);
                                Class36.smethod_9(pointAngle, point3d2);
                            }
                        }
                        pointXY5 = CAD.GetPointXY(point, -400.0, unchecked ((double)(checked (0L - num3)) / 2.0 - 2500.0));
                        Class36.smethod_6(pointXY5, "L1", 100.0, "1:20");
                    }
                }
            }
        }
Exemple #4
0
        public void TcWuMian()
        {
            int    num;
            int    num18;
            object obj;

            try
            {
IL_01:
                ProjectData.ClearProjectError();
                num = -2;
IL_09:
                int num2 = 2;
                long[] array = null;
IL_0D:
                num2 = 3;
                Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument;
IL_1A:
                num2 = 4;
                Database database = mdiActiveDocument.Database;
IL_24:
                num2 = 5;
                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);
                    Class36.smethod_60("请按照顺序选择>");
                    PromptSelectionResult selection = mdiActiveDocument.Editor.GetSelection(selectionFilter);
                    short     num3;
                    double    num9;
                    Point3d[] array4;
                    short     num15;
                    checked
                    {
                        short num6;
                        if (selection.Status == 5100)
                        {
                            SelectionSet value = selection.Value;
                            num3  = (short)(value.Count - 1);
                            array = new long[(int)(num3 + 1)];
                            short num4 = 0;
                            short num5 = num3;
                            num6 = num4;
                            for (;;)
                            {
                                short num7 = num6;
                                short num8 = num5;
                                if (num7 > num8)
                                {
                                    break;
                                }
                                DBText dbtext = (DBText)transaction.GetObject(value[(int)num6].ObjectId, 1);
                                array[(int)num6] = (long)Math.Round(Conversion.Val(dbtext.TextString));
                                unchecked
                                {
                                    num6 += 1;
                                }
                            }
                        }
                        num9      = Class36.smethod_30("请输入跨度(默认6000):", 6000.0);
                        array4    = new Point3d[(int)(num3 + 1)];
                        array4[0] = CAD.GetPoint("选择插入点: ");
                        Point3d point3d;
                        if (array4[0] == point3d)
                        {
                            goto IL_5A1;
                        }
                        short num10 = 0;
                        short num11 = (short)(Information.UBound(array, 1) - 1);
                        num6 = num10;
                        Point3d pointAngle;
                        for (;;)
                        {
                            short num12 = num6;
                            short num8  = num11;
                            if (num12 > num8)
                            {
                                break;
                            }
                            pointAngle = CAD.GetPointAngle(array4[(int)num6], num9, 0.0);
                            CAD.AddLine(array4[(int)num6], pointAngle, "0");
                            array4[(int)(num6 + 1)] = CAD.GetPointAngle(array4[(int)num6], (double)array[(int)num6], 270.0);
                            unchecked
                            {
                                num6 += 1;
                            }
                        }
                        pointAngle = CAD.GetPointAngle(array4[(int)num6], num9, 0.0);
                        CAD.AddLine(array4[(int)num6], pointAngle, "0");
                        Point3d[] array5 = new Point3d[4];
                        Point3d[] array6 = new Point3d[4];
                        pointAngle = CAD.GetPointAngle(array4[0], num9, 0.0);
                        array5[0]  = CAD.GetPointAngle(array4[0], 200.0, 45.0);
                        array5[1]  = CAD.GetPointAngle(array4[0], 200.0, 315.0);
                        array6[0]  = CAD.GetPointAngle(pointAngle, 200.0, 135.0);
                        array6[1]  = CAD.GetPointAngle(pointAngle, 200.0, 225.0);
                        pointAngle = CAD.GetPointAngle(array4[1], num9, 0.0);
                        Point3d p = Class36.smethod_46(array4[1], pointAngle);
                        array5[2] = CAD.GetPointAngle(p, 200.0, 135.0);
                        array5[3] = CAD.GetPointAngle(p, 200.0, 225.0);
                        array6[2] = CAD.GetPointAngle(p, 200.0, 45.0);
                        array6[3] = CAD.GetPointAngle(p, 200.0, 315.0);
                        Point3d pointAngle2 = CAD.GetPointAngle(p, 141.0, 90.0);
                        Point3d pointAngle3 = CAD.GetPointAngle(p, (double)(array[0] + 141L), 270.0);
                        CAD.AddPline(array5, 0.0, false, "");
                        CAD.AddPline(array6, 0.0, false, "");
                        CAD.AddLine(pointAngle2, pointAngle3, "0");
                        short num13 = (short)Math.Round(unchecked ((double)Information.UBound(array, 1) / 2.0 - 1.0));
                        short num14 = 1;
                        num15 = num13 - 1;
                        num3  = num14;
                    }
                    for (;;)
                    {
                        short num16 = num3;
                        short num8  = num15;
                        if (num16 > num8)
                        {
                            break;
                        }
                        Point3d pointAngle  = CAD.GetPointAngle(array4[(int)num3], num9 / 2.0 + Math.Pow(-1.0, (double)num3) * 70.0, 0.0);
                        Point3d pointAngle4 = CAD.GetPointAngle(pointAngle, (double)array[(int)num3], 270.0);
                        CAD.AddLine(pointAngle, pointAngle4, "0");
                        num3 += 1;
                    }
                    transaction.Commit();
                }
IL_4FC:
                num2 = 7;
                if (Information.Err().Number <= 0)
                {
                    goto IL_521;
                }
IL_50D:
                num2 = 8;
                Interaction.MsgBox(Information.Err().Description, MsgBoxStyle.OkOnly, null);
IL_521:
                goto IL_5A1;
IL_523:
                int num17 = num18 + 1;
                num18     = 0;
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num17);
IL_55B:
                goto IL_596;
IL_55D:
                num18 = num2;
                if (num <= -2)
                {
                    goto IL_523;
                }
                @switch(ICSharpCode.Decompiler.ILAst.ILLabel[], num);
                IL_573 :;
            }
            catch when(endfilter(obj is Exception & num != 0 & num18 == 0))
            {
                Exception ex = (Exception)obj2;

                goto IL_55D;
            }
IL_596:
            throw ProjectData.CreateProjectError(-2146828237);
IL_5A1:
            if (num18 != 0)
            {
                ProjectData.ClearProjectError();
            }
        }