Exemplo n.º 1
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();
            }
        }
Exemplo n.º 2
0
        public void DrawCengGaoBiao()
        {
            Class36.SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle);
            DocumentLock documentLock = Application.DocumentManager.MdiActiveDocument.LockDocument();
            Point3d      point3d      = CAD.GetPoint("选择插入点: ");

            checked
            {
                Point3d point3d2;
                if (!(point3d == point3d2))
                {
                    Class36.smethod_23(CAD.GetPointXY(point3d, 500.0, 150.0), "层号", 350.0, 0, "");
                    Class36.smethod_23(CAD.GetPointXY(point3d, 1800.0, 150.0), "层高(m)", 350.0, 0, "");
                    Class36.smethod_23(CAD.GetPointXY(point3d, 3300.0, 150.0), "标高(m)", 350.0, 0, "");
                    if (this.CheckBox1.Checked)
                    {
                        Class36.smethod_23(CAD.GetPointXY(point3d, 4800.0, 150.0), "墙柱砼", 350.0, 0, "");
                    }
                    if (this.CheckBox1.Checked)
                    {
                        Class36.smethod_23(CAD.GetPointXY(point3d, 6300.0, 150.0), "梁板砼", 350.0, 0, "");
                    }
                    short num = (short)this.DataGridView1.Rows.Count;
                    CAD.AddLine(CAD.GetPointXY(point3d, 1500.0, 0.0), CAD.GetPointXY(point3d, 1500.0, (double)((num + 1) * 600)), "0");
                    CAD.AddLine(CAD.GetPointXY(point3d, 3000.0, 0.0), CAD.GetPointXY(point3d, 3000.0, (double)((num + 1) * 600)), "0");
                    if (this.CheckBox1.Checked)
                    {
                        CAD.AddLine(CAD.GetPointXY(point3d, 4500.0, 0.0), CAD.GetPointXY(point3d, 4500.0, (double)((num + 1) * 600)), "0");
                    }
                    if (this.CheckBox1.Checked)
                    {
                        CAD.AddLine(CAD.GetPointXY(point3d, 6000.0, 0.0), CAD.GetPointXY(point3d, 6000.0, (double)((num + 1) * 600)), "0");
                    }
                    long num2 = 5000L;
                    if (this.CheckBox1.Checked)
                    {
                        num2 = 7500L;
                    }
                    CAD.AddLine(CAD.GetPointXY(point3d, 0.0, (double)(num * 600)), CAD.GetPointXY(point3d, (double)num2, (double)(num * 600)), "0");
                    CAD.AddLine(CAD.GetPointXY(point3d, 0.0, (double)((num - 1) * 600)), CAD.GetPointXY(point3d, (double)num2, (double)((num - 1) * 600)), "0");
                    num -= 2;
                    string[] array  = new string[(int)(num + 1)];
                    string[] array2 = new string[(int)(num + 1)];
                    string[] array3 = new string[(int)(num + 1 + 1)];
                    string[] array4 = new string[(int)(num + 1)];
                    string[] array5 = new string[(int)(num + 1 + 1)];
                    array5[0] = "-";
                    short num3 = 0;
                    short num4 = num;
                    short num5 = num3;
                    for (;;)
                    {
                        short num6 = num5;
                        short num7 = num4;
                        if (num6 > num7)
                        {
                            break;
                        }
                        CAD.AddLine(CAD.GetPointXY(point3d, 0.0, (double)(num5 * 600)), CAD.GetPointXY(point3d, (double)num2, (double)(num5 * 600)), "0");
                        array[(int)num5] = Conversions.ToString(this.DataGridView1.Rows[(int)num5].Cells[0].Value);
                        double num8 = Conversions.ToDouble(Operators.DivideObject(this.DataGridView1.Rows[(int)num5].Cells[1].Value, 1000));
                        array2[(int)num5] = Strings.Format(num8, "0.000");
                        if (Operators.ConditionalCompareObjectEqual(this.DataGridView1.Rows[(int)num5].Cells[2].Value, "0.000", false))
                        {
                            array3[(int)num5] = Conversions.ToString(this.DataGridView1.Rows[(int)num5].Cells[2].Value);
                        }
                        else
                        {
                            array3[(int)num5] = Conversions.ToString(this.DataGridView1.Rows[(int)num5].Cells[2].Value);
                        }
                        if (this.CheckBox1.Checked)
                        {
                            array4[(int)num5] = Conversions.ToString(this.DataGridView1.Rows[(int)num5].Cells[3].Value);
                            if (!array4[(int)num5].ToUpper().Contains("C"))
                            {
                                array4[(int)num5] = "C" + array4[(int)num5].ToUpper();
                            }
                            else
                            {
                                array4[(int)num5] = array4[(int)num5].ToUpper();
                            }
                        }
                        if (this.CheckBox1.Checked)
                        {
                            array5[(int)(num5 + 1)] = Conversions.ToString(this.DataGridView1.Rows[(int)num5].Cells[4].Value);
                            if (!array5[(int)(num5 + 1)].ToUpper().Contains("C"))
                            {
                                array5[(int)(num5 + 1)] = "C" + array5[(int)(num5 + 1)].ToUpper();
                            }
                            else
                            {
                                array5[(int)(num5 + 1)] = array5[(int)(num5 + 1)].ToUpper();
                            }
                        }
                        unchecked
                        {
                            num5 += 1;
                        }
                    }
                    double num9 = Conversions.ToDouble(Operators.AddObject(this.DataGridView1.Rows[(int)num].Cells[2].Value, Operators.DivideObject(this.DataGridView1.Rows[(int)num].Cells[1].Value, 1000)));
                    array3[(int)(num + 1)] = Strings.Format(num9, "0.000");
                    Class36.smethod_21(CAD.GetPointXY(point3d, 1000.0, 150.0), array, 300.0, -2.0);
                    Class36.smethod_20(CAD.GetPointXY(point3d, 1800.0, 150.0), array2, 300.0, -2.0, "");
                    Class36.smethod_21(CAD.GetPointXY(point3d, 4200.0, 150.0), array3, 300.0, -2.0);
                    if (this.CheckBox1.Checked)
                    {
                        Class36.smethod_20(CAD.GetPointXY(point3d, 4800.0, 150.0), array4, 300.0, -2.0, "");
                    }
                    if (this.CheckBox1.Checked)
                    {
                        Class36.smethod_20(CAD.GetPointXY(point3d, 6300.0, 150.0), array5, 300.0, -2.0, "");
                    }
                    if (this.CheckBox1.Checked)
                    {
                        num2 = 3750L;
                    }
                    else
                    {
                        num2 = 2500L;
                    }
                    point3d = CAD.GetPointXY(point3d, (double)num2, -1500.0);
                    Class36.smethod_24(point3d, "结构层高表", 500.0, 0, "");
                    point3d = CAD.GetPointXY(point3d, 0.0, -750.0);
                    Class36.smethod_24(point3d, "注:标高均为楼面结构标高", 350.0, 0, "");
                    Point3d[] array6 = new Point3d[]
                    {
                        CAD.GetPointXY(point3d, -1500.0, 600.0),
                        CAD.GetPointXY(point3d, 1500.0, 600.0)
                    };
                    CAD.AddPline(array6, 75.0, false, "");
                    CAD.AddLine(CAD.GetPointAngle(array6[0], 125.0, -90.0), CAD.GetPointAngle(array6[1], 125.0, -90.0), "0");
                    documentLock.Dispose();
                }
            }
        }