public void DrawPM(DatabaseToAcad block)
        {
            //                1a                                            2a
            //                 /------------------/-/------------------------/
            //                /                3 / / 4                      /
            //             1e/------------------/ /------------------------/ 2e
            //              /                                             /
            //             /  3a  __/---------/ /---------------\    8a  /
            //          1d/  /---/ 5a        / /              6a \---/  /2d
            //           /  /  4a           / /                  7a /  /
            //         1/--/---------------/ /---------------------/--/
            //         /  /  4b           / /                7b   /  /
            //      1c/  /---\_ 5b    1a / / 2a          6b_/----/  /2c
            //       /  3b      \-------/ /---------------/    8b  /
            //      /                                             /
            //   1f/------------------/ /------------------------/2f
            //    /                 1/ /2                       /
            //   /------------------/-/------------------------/
            //  1b                                            2b

            TxCurve center2 = null;
            TxCurve borderDn2 = null;
            TxCurve borderUp2 = null;
            if (center == null)
            {
                center2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                center2 = AcadAssist.CloneTxCurve(center);
            }
            if (borderDn == null)
            {
                borderDn2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                borderDn2 = AcadAssist.CloneTxCurve(borderDn);
            }
            if (borderUp == null)
            {
                borderUp2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                borderUp2 = AcadAssist.CloneTxCurve(borderUp);
            }

            TxLine borderLeft = new TxLine(borderDn2.StartPoint, borderUp2.StartPoint);
            TxLine borderRight = new TxLine(borderDn2.EndPoint, borderUp2.EndPoint);

            Vector3d vectCenterLine = center2.StartPoint.GetVectorTo(center2.EndPoint).GetNormal();
            Point3d ctPoint1 = center2.StartPoint;
            Point3d ctPoint1c = ctPoint1 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint1d = ctPoint1 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint1e = ctPoint1 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5) / Math.Cos(alf1);
            Point3d ctPoint1f = ctPoint1 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5) / Math.Cos(alf1);

            Point3d ctPoint2 = center2.EndPoint;
            Point3d ctPoint2c = ctPoint2 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint2d = ctPoint2 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint2e = ctPoint2 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5) / Math.Cos(alf2);
            Point3d ctPoint2f = ctPoint2 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5) / Math.Cos(alf2);

            Point3d ctPoint33 = center2.GetPointAtDist(Ln);
            Point3d ctPoint33a = ctPoint33 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint33b = ctPoint33 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint44 = center2.GetPointAtDist(Ln + Ld);
            Point3d ctPoint44a = ctPoint44 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint44b = ctPoint44 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf1);
            Point3d ctPoint55 = center2.GetPointAtDist(Ln + Ld + Ldx);
            Point3d ctPoint55a = ctPoint55 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFb) / Math.Cos(alf1);
            Point3d ctPoint55b = ctPoint55 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (Wbox * 0.5 - WFb) / Math.Cos(alf1);

            Point3d ctPoint8 = center2.GetPointAtDist(L - Ln);
            Point3d ctPoint8a = ctPoint8 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint8b = ctPoint8 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint7 = center2.GetPointAtDist(L - Ln - Ld);
            Point3d ctPoint7a = ctPoint7 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint7b = ctPoint7 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFbx) / Math.Cos(alf2);
            Point3d ctPoint6 = center2.GetPointAtDist(L - Ln - Ld - Ldx);
            Point3d ctPoint6a = ctPoint6 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFb) / Math.Cos(alf2);
            Point3d ctPoint6b = ctPoint6 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (Wbox * 0.5 - WFb) / Math.Cos(alf2);

            //外轮廓
            block.AddCurve(center2, CommonLayer.cenlayer);
            //block.AddLine(borderDn2, CommonLayer.cenlayer);           //上下构造边线
            //block.AddLine(borderUp2, CommonLayer.cenlayer);           //上下构造边线
            block.AddLine(borderLeft, CommonLayer.cenlayer);            //左右构造边线
            block.AddLine(borderRight, CommonLayer.cenlayer);           //左右构造边线
            TxLine boxLineUp = new TxLine(ctPoint1e, ctPoint2e);
            TxLine boxLineDn = new TxLine(ctPoint1f, ctPoint2f);
            //block.AddLine(boxLineUp, CommonLayer.gz2layer);
            //block.AddLine(boxLineDn, CommonLayer.gz2layer);

            //内轮廓
            TxLine boxLineInBoxUp = new TxLine(ctPoint55a, ctPoint6a);
            TxLine boxLineInBoxDn = new TxLine(ctPoint55b, ctPoint6b);
            block.AddLine(ctPoint33a, ctPoint33b, CommonLayer.gz2layer);
            block.AddLine(ctPoint8a, ctPoint8b, CommonLayer.gz2layer);
            block.AddLine(ctPoint33a, ctPoint44a, CommonLayer.gz2layer);
            block.AddLine(ctPoint44a, ctPoint55a, CommonLayer.gz2layer);
            //block.AddLine(ctPoint55a, ctPoint6a, CommonLayer.gz2layer);
            block.AddLine(ctPoint6a, ctPoint7a, CommonLayer.gz2layer);
            block.AddLine(ctPoint7a, ctPoint8a, CommonLayer.gz2layer);

            block.AddLine(ctPoint33b, ctPoint44b, CommonLayer.gz2layer);
            block.AddLine(ctPoint44b, ctPoint55b, CommonLayer.gz2layer);
            //block.AddLine(ctPoint55b, ctPoint6b, CommonLayer.gz2layer);
            block.AddLine(ctPoint6b, ctPoint7b, CommonLayer.gz2layer);
            block.AddLine(ctPoint7b, ctPoint8b, CommonLayer.gz2layer);

            List<TxLine> hlCenters;
            List<TxLine> hlLinesL;
            List<TxLine> hlLinesR;
            this.GetHLLine(out hlCenters, out hlLinesL, out hlLinesR);

            //箱室外缘线
            List<Point3d> breakPointsUp = new List<Point3d>();
            List<Point3d> breakPointsDn = new List<Point3d>();
            breakPointsUp.Add(boxLineUp.StartPoint);
            breakPointsUp.Add(boxLineUp.EndPoint);
            breakPointsDn.Add(boxLineDn.StartPoint);
            breakPointsDn.Add(boxLineDn.EndPoint);
            for (int i = 0; i < hlLinesL.Count; i++)
            {
                Point3d tempUpPoint1 = AcadAssist.GetIntersectionPoint(boxLineUp, hlLinesL[i]);
                Point3d tempUpPoint2 = AcadAssist.GetIntersectionPoint(boxLineUp, hlLinesR[i]);
                breakPointsUp.Add(tempUpPoint1);
                breakPointsUp.Add(tempUpPoint2);

                Point3d tempDnPoint1 = AcadAssist.GetIntersectionPoint(boxLineDn, hlLinesL[i]);
                Point3d tempDnPoint2 = AcadAssist.GetIntersectionPoint(boxLineDn, hlLinesR[i]);
                breakPointsDn.Add(tempDnPoint1);
                breakPointsDn.Add(tempDnPoint2);
            }
            breakPointsUp.Sort(new CompairPoint3dX());
            breakPointsDn.Sort(new CompairPoint3dX());
            if (type == BeamLocate.Mid)
            {
                for (int i = 0; i < breakPointsUp.Count / 2; i++)
                {
                    block.AddLine(breakPointsUp[i * 2], breakPointsUp[i * 2 + 1], CommonLayer.gz2layer);
                }
                for (int i = 0; i < breakPointsDn.Count / 2; i++)
                {
                    block.AddLine(breakPointsDn[i * 2], breakPointsDn[i * 2 + 1], CommonLayer.gz2layer);
                }
            }
            else if (type == BeamLocate.Right)
            {
                block.AddLine(boxLineDn, CommonLayer.gz2layer);
                for (int i = 0; i < breakPointsUp.Count / 2; i++)
                {
                    block.AddLine(breakPointsUp[i * 2], breakPointsUp[i * 2 + 1], CommonLayer.gz2layer);
                }
            }
            else if (type == BeamLocate.Left)
            {
                block.AddLine(boxLineUp, CommonLayer.gz2layer);
                for (int i = 0; i < breakPointsDn.Count / 2; i++)
                {
                    block.AddLine(breakPointsDn[i * 2], breakPointsDn[i * 2 + 1], CommonLayer.gz2layer);
                }
            }

            //箱室内缘线
            List<Point3d> breakPointsInBoxUp = new List<Point3d>();
            List<Point3d> breakPointsInBoxDn = new List<Point3d>();
            breakPointsInBoxUp.Add(boxLineInBoxUp.StartPoint);
            breakPointsInBoxUp.Add(boxLineInBoxUp.EndPoint);
            breakPointsInBoxDn.Add(boxLineInBoxDn.StartPoint);
            breakPointsInBoxDn.Add(boxLineInBoxDn.EndPoint);
            for (int i = 1; i < hlLinesL.Count - 1; i++)
            {
                Point3d tempUpPoint1 = AcadAssist.GetIntersectionPoint(boxLineInBoxUp, hlLinesL[i]);
                Point3d tempUpPoint2 = AcadAssist.GetIntersectionPoint(boxLineInBoxUp, hlLinesR[i]);
                breakPointsInBoxUp.Add(tempUpPoint1);
                breakPointsInBoxUp.Add(tempUpPoint2);

                Point3d tempDnPoint1 = AcadAssist.GetIntersectionPoint(boxLineInBoxDn, hlLinesL[i]);
                Point3d tempDnPoint2 = AcadAssist.GetIntersectionPoint(boxLineInBoxDn, hlLinesR[i]);
                breakPointsInBoxDn.Add(tempDnPoint1);
                breakPointsInBoxDn.Add(tempDnPoint2);
            }
            breakPointsInBoxUp.Sort(new CompairPoint3dX());
            breakPointsInBoxDn.Sort(new CompairPoint3dX());
            for (int i = 0; i < breakPointsInBoxUp.Count / 2; i++)
            {
                block.AddLine(breakPointsInBoxUp[i * 2], breakPointsInBoxUp[i * 2 + 1], CommonLayer.gz2layer);
            }
            for (int i = 0; i < breakPointsInBoxDn.Count / 2; i++)
            {
                block.AddLine(breakPointsInBoxDn[i * 2], breakPointsInBoxDn[i * 2 + 1], CommonLayer.gz2layer);
            }
            //箱室内缘线

            //横梁线--考虑打断
            for (int i = 0; i < hlCenters.Count; i++)
                block.AddLine(hlCenters[i], CommonLayer.cenlayer);
            for (int i = 0; i < hlLinesL.Count; i++)
            {
                Point3d xPoint1 = AcadAssist.GetIntersectionPoint(boxLineDn, hlLinesL[i]);
                Point3d xPoint2 = AcadAssist.GetIntersectionPoint(boxLineDn, hlLinesR[i]);
                Point3d xPoint3 = AcadAssist.GetIntersectionPoint(boxLineUp, hlLinesL[i]);
                Point3d xPoint4 = AcadAssist.GetIntersectionPoint(boxLineUp, hlLinesR[i]);

                if (type == BeamLocate.Mid || type == BeamLocate.Left)
                {
                    block.AddLine(xPoint1, hlLinesL[i].StartPoint, CommonLayer.gz2layer);
                    block.AddLine(xPoint2, hlLinesR[i].StartPoint, CommonLayer.gz2layer);
                }
                if (type == BeamLocate.Mid || type == BeamLocate.Right)
                {
                    block.AddLine(xPoint3, hlLinesL[i].EndPoint, CommonLayer.gz2layer);
                    block.AddLine(xPoint4, hlLinesR[i].EndPoint, CommonLayer.gz2layer);
                }

                if (i != 0 && i != hlLinesL.Count - 1)
                {
                    Point3d xPoint1a = AcadAssist.GetIntersectionPoint(boxLineInBoxDn, hlLinesL[i]);
                    Point3d xPoint2a = AcadAssist.GetIntersectionPoint(boxLineInBoxDn, hlLinesR[i]);
                    Point3d xPoint3a = AcadAssist.GetIntersectionPoint(boxLineInBoxUp, hlLinesL[i]);
                    Point3d xPoint4a = AcadAssist.GetIntersectionPoint(boxLineInBoxUp, hlLinesR[i]);
                    block.AddLine(xPoint1a, xPoint3a, CommonLayer.gz2layer);
                    block.AddLine(xPoint2a, xPoint4a, CommonLayer.gz2layer);
                }
            }

            //腹板中心线
            //Curve centerLine = AcadAssist.TrimCurveGetFront(center2, AcadAssist.GetIntersectionPoint(center2, borderRight));
            TxCurve centerLine = AcadAssist.CloneTxCurve(center2);
            block.AddCurve(centerLine, CommonLayer.cenlayer);
            //中心线长度
            double Length = center2.GetDistAtPoint(center2.EndPoint);
            Point3d textPoint = center2.GetPointAtDist(Length * 0.4);
            Vector3d textVect = center2.GetFirstDerivative(textPoint);
            //double textAngle = textVect.AngleOnPlane(center2.GetPlane());
            double textAngle = AcadAssist.AngleOnPlan(textVect, center2);
            block.AddText(textPoint, String.Format("中心线长度{0:F0}", Length), block.style.RealTextHeigth * 1000, textAngle, CommonLayer.dimlayer, TxTextHorizontalMode.TextCenter, TxTextVerticalMode.TextBottom);

            //角度标注
            for (int i = 0; i < hlCenters.Count; i++)
            {
                Point3d hlPointx = AcadAssist.GetIntersectionPoint(center2, hlCenters[i]);
                Vector3d curVectx = center2.GetFirstDerivative(hlPointx).GetNormal();
                Vector3d vectHL = hlCenters[i].EndPoint.GetVectorTo(hlCenters[i].StartPoint).GetNormal();
                if (i == hlCenters.Count - 1)
                    block.AddDimAngularFix(hlPointx, hlPointx - curVectx * block.style.BlockScale * 2000, hlPointx + vectHL * block.style.BlockScale * 2000, block.style.DimFirstLayer * 1000);
                else
                    block.AddDimAngularFix(hlPointx, hlPointx + curVectx * block.style.BlockScale * 2000, hlPointx + vectHL * block.style.BlockScale * 2000, block.style.DimFirstLayer * 1000);
            }
        }
        public void DrawCenterLine(DatabaseToAcad block, string cenlineString)
        {
            List<TxCurve> cenlines = this.GetReal_CenterAndBorderCurve();
            TxCurve center2 = cenlines[0];
            TxCurve borderDn2 = cenlines[1];
            TxCurve borderUp2 = cenlines[2];

            TxLine borderLeft = new TxLine(borderDn2.StartPoint, borderUp2.StartPoint);
            TxLine borderRight = new TxLine(borderDn2.EndPoint, borderUp2.EndPoint);

            //腹板中心线
            //Curve centerLine = AcadAssist.TrimCurveGetFront(center2, AcadAssist.GetIntersectionPoint(center2, borderRight));
            TxCurve centerLine = AcadAssist.CloneTxCurve(center2);
            //if (CommonSimbel.lineTypeCENT != Autodesk.AutoCAD.DatabaseServices.ObjectId.Null) centerLine.LinetypeId = CommonSimbel.lineTypeCENT;
            block.AddCurve(centerLine, CommonSimbel.centLineType, CommonLayer.gz1layer);
            //中心线长度
            double Length = center2.GetDistAtPoint(center2.EndPoint);
            Point3d textPoint = center2.GetPointAtDist(Length * 0.5);
            Vector3d textVect = center2.GetFirstDerivative(textPoint);
            double textAngle = AcadAssist.AngleOnPlan(textVect, center2);
            if (cenlineString == "")
            {
                block.AddText(textPoint, String.Format("梁中心线 L={0}", CommonSimbel.ConvertToDimStr(Length)), block.style.RealTextHeigth * 1000, textAngle, CommonLayer.dimlayer, TxTextHorizontalMode.TextCenter, TxTextVerticalMode.TextBottom);
            }
            else
            {
                block.AddText(textPoint, String.Format(cenlineString, block.style.RealTextHeigth * 1000, textAngle, CommonLayer.dimlayer, TxTextHorizontalMode.TextCenter, TxTextVerticalMode.TextBottom);
            }

            ///中心线起点处角度标注
            Point3d anglePoint1 = center2.StartPoint;
            Vector3d curVectx1 = center2.GetFirstDerivative(anglePoint1).GetNormal();
            Vector3d vectHL = borderLeft.EndPoint.GetVectorTo(borderLeft.StartPoint).GetNormal();
            block.AddDimAngularFix(anglePoint1, anglePoint1 + curVectx1 * block.style.DimFirstLayer * 1000, anglePoint1 + vectHL * block.style.DimFirstLayer * 1000, block.style.DimFirstLayer * 1000);

            ///中心线终点处角度标注
            Point3d anglePoint2 = center2.EndPoint;
            Vector3d curVectx2 = center2.GetFirstDerivative(anglePoint2).GetNormal();
            Vector3d vectHR = borderRight.EndPoint.GetVectorTo(borderRight.StartPoint).GetNormal();
            block.AddDimAngularFix(anglePoint2, anglePoint2 - curVectx2 * block.style.DimFirstLayer * 1000, anglePoint2 + vectHR * block.style.DimFirstLayer * 1000, block.style.DimFirstLayer * 1000);
        }
Beispiel #3
0
        public void DrawPM(DatabaseToAcad block)
        {
            //         1a                                         2a
            //          /-----------------/-----------------------/
            //         /  3a             /               5a      /
            //      1c/----\_ 4a        /            6a_/-------/2c
            //       /       \---------/--------------/        /
            //     1/-----------------/-----------------------/
            //     /      __/--------/---------------\       /
            //  1d/ -----/ 4b       /              6b \-----/2d
            //   /     3b          /                  5b   /
            //  /-----------------/-----------------------/
            //1b                                        2b

            if (center != null && center.StartPoint.X > center.EndPoint.X)
            {
                center = AcadAssist.ReverseTxLine(center);
            }
            if (borderDn != null && borderDn.StartPoint.X > borderDn.EndPoint.X)
            {
                borderDn = AcadAssist.ReverseCurve(borderDn);
            }
            if (borderUp != null && borderUp.StartPoint.X > borderUp.EndPoint.X)
            {
                borderUp = AcadAssist.ReverseCurve(borderUp);
            }

            TxLine center2 = null;
            TxCurve borderDn2 = null;
            TxCurve borderUp2 = null;
            if (center == null)
            {
                center2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                center2 = AcadAssist.CloneTxLine(center);
            }
            if (borderDn == null)
            {
                borderDn2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                borderDn2 = AcadAssist.CloneTxCurve(borderDn);
            }
            if (borderUp == null)
            {
                borderUp2 = new TxLine(new Point3d(0, 0, 0), new Point3d(L, 0, 0));
            }
            else
            {
                borderUp2 = AcadAssist.CloneTxCurve(borderUp);
            }

            TxLine borderLeft = new TxLine(borderDn2.StartPoint, borderUp2.StartPoint);
            TxLine borderRight = new TxLine(borderDn2.EndPoint, borderUp2.EndPoint);
            Vector3d vectCenterLine = center2.StartPoint.GetVectorTo(center2.EndPoint).GetNormal();
            Point3d ctPoint1 = center2.StartPoint;
            //Point3d ctPoint1a = new Point3d(ctPoint1.X + Math.Tan(alf1) * WTL1, ctPoint1.Y + WTL1, 0);
            //Point3d ctPoint1b = new Point3d(ctPoint1.X - Math.Tan(alf1) * WTL2, ctPoint1.Y - WTL2, 0);

            Point3d ctPoint1c = ctPoint1 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (WD * 0.5) / Math.Cos(alf1);
            Point3d ctPoint1d = ctPoint1 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf1, Vector3d.ZAxis) * (WD * 0.5) / Math.Cos(alf1);

            //Point3d ctPoint1c = new Point3d(ctPoint1.X + Math.Tan(alf1) * WD * 0.5, ctPoint1.Y + WD * 0.5, 0);
            //Point3d ctPoint1d = new Point3d(ctPoint1.X - Math.Tan(alf1) * WD * 0.5, ctPoint1.Y - WD * 0.5, 0);

            Point3d ctPoint2 = center2.EndPoint;
            //Point3d ctPoint2a = new Point3d(ctPoint2.X + Math.Tan(alf2) * WTR1, ctPoint1.Y + WTR1, 0);
            //Point3d ctPoint2b = new Point3d(ctPoint2.X - Math.Tan(alf2) * WTR2, ctPoint1.Y - WTR2, 0);
            Point3d ctPoint2c = ctPoint2 + vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (WD * 0.5) / Math.Cos(alf2);
            Point3d ctPoint2d = ctPoint2 - vectCenterLine.RotateBy(Math.PI * 0.5 + alf2, Vector3d.ZAxis) * (WD * 0.5) / Math.Cos(alf2);

            //Point3d ctPoint2c = new Point3d(ctPoint2.X + Math.Tan(alf2) * WD * 0.5, ctPoint2.Y + WD * 0.5, 0);
            //Point3d ctPoint2d = new Point3d(ctPoint2.X - Math.Tan(alf2) * WD * 0.5, ctPoint2.Y - WD * 0.5, 0);

            Point3d ctPoint3 = center2.GetPointAtDist(Ld);
            Point3d ctPoint3a = new Point3d(ctPoint3.X + Math.Tan(alf1) * WD * 0.5, ctPoint3.Y + WD * 0.5, 0);
            Point3d ctPoint3b = new Point3d(ctPoint3.X - Math.Tan(alf1) * WD * 0.5, ctPoint3.Y - WD * 0.5, 0);
            Point3d ctPoint4 = center2.GetPointAtDist(Ld + Ldx);
            Point3d ctPoint4a = new Point3d(ctPoint4.X + Math.Tan(alf1) * WFb * 0.5, ctPoint3.Y + WFb * 0.5, 0);
            Point3d ctPoint4b = new Point3d(ctPoint4.X - Math.Tan(alf1) * WFb * 0.5, ctPoint3.Y - WFb * 0.5, 0);

            Point3d ctPoint5 = center2.GetPointAtDist(L - Ld);
            Point3d ctPoint5a = new Point3d(ctPoint5.X + Math.Tan(alf2) * WD * 0.5, ctPoint5.Y + WD * 0.5, 0);
            Point3d ctPoint5b = new Point3d(ctPoint5.X - Math.Tan(alf2) * WD * 0.5, ctPoint5.Y - WD * 0.5, 0);

            Point3d ctPoint6 = center2.GetPointAtDist(L - Ld - Ldx);
            Point3d ctPoint6a = new Point3d(ctPoint6.X + Math.Tan(alf2) * WFb * 0.5, ctPoint6.Y + WFb * 0.5, 0);
            Point3d ctPoint6b = new Point3d(ctPoint6.X - Math.Tan(alf2) * WFb * 0.5, ctPoint6.Y - WFb * 0.5, 0);

            //外轮廓
            //TxLine sideLine1 = new TxLine(ctPoint1a, ctPoint2a);
            //TxLine sideLine2 = new TxLine(ctPoint1b, ctPoint2b);
            //block.AddLine(ctPoint1a, ctPoint1b, CommonLayer.gz1layer);
            //block.AddLine(ctPoint2a, ctPoint2b, CommonLayer.gz1layer);
            //block.AddLine(ctPoint1a, ctPoint2a, CommonLayer.gz1layer);
            //block.AddLine(ctPoint1b, ctPoint2b, CommonLayer.gz1layer);
            //内轮廓
            TxPolyline plineUp = new TxPolyline();
            plineUp.AddVertexAt(0, new Point2d(ctPoint1c.X, ctPoint1c.Y), 0, 0, 0);
            plineUp.AddVertexAt(1, new Point2d(ctPoint3a.X, ctPoint3a.Y), 0, 0, 0);
            plineUp.AddVertexAt(2, new Point2d(ctPoint4a.X, ctPoint4a.Y), 0, 0, 0);
            plineUp.AddVertexAt(3, new Point2d(ctPoint6a.X, ctPoint6a.Y), 0, 0, 0);
            plineUp.AddVertexAt(4, new Point2d(ctPoint5a.X, ctPoint5a.Y), 0, 0, 0);
            plineUp.AddVertexAt(5, new Point2d(ctPoint2c.X, ctPoint2c.Y), 0, 0, 0);
            //block.AddPolyline(plineUp, CommonLayer.gz2layer);
            TxPolyline plineDn = new TxPolyline();
            plineDn.AddVertexAt(0, new Point2d(ctPoint1d.X, ctPoint1d.Y), 0, 0, 0);
            plineDn.AddVertexAt(1, new Point2d(ctPoint3b.X, ctPoint3b.Y), 0, 0, 0);
            plineDn.AddVertexAt(2, new Point2d(ctPoint4b.X, ctPoint4b.Y), 0, 0, 0);
            plineDn.AddVertexAt(3, new Point2d(ctPoint6b.X, ctPoint6b.Y), 0, 0, 0);
            plineDn.AddVertexAt(4, new Point2d(ctPoint5b.X, ctPoint5b.Y), 0, 0, 0);
            plineDn.AddVertexAt(5, new Point2d(ctPoint2d.X, ctPoint2d.Y), 0, 0, 0);
            //block.AddPolyline(plineDn, CommonLayer.gz2layer);

            //获取横梁线
            List<TxLine> hlCenters;
            List<TxLine> hlLinesL;
            List<TxLine> hlLinesR;
            this.GetHLLine(out hlCenters, out hlLinesL, out hlLinesR);

            //绘制横梁线--考虑剪切断开
            for (int i = 0; i < hlCenters.Count; i++)
                block.AddLine(hlCenters[i], CommonLayer.cenlayer);
            for (int i = 0; i < hlLinesL.Count; i++)
            {
                Point3d xPoint1 = AcadAssist.GetIntersectionPoint(plineDn, hlLinesL[i]);
                Point3d xPoint2 = AcadAssist.GetIntersectionPoint(plineDn, hlLinesR[i]);
                Point3d xPoint3 = AcadAssist.GetIntersectionPoint(plineUp, hlLinesL[i]);
                Point3d xPoint4 = AcadAssist.GetIntersectionPoint(plineUp, hlLinesR[i]);

                if (type == BeamLocate.Mid || type == BeamLocate.Left)
                {
                    block.AddLine(xPoint1, hlLinesL[i].StartPoint, CommonLayer.gz2layer);
                    block.AddLine(xPoint2, hlLinesR[i].StartPoint, CommonLayer.gz2layer);
                }
                if (type == BeamLocate.Mid || type == BeamLocate.Right)
                {
                    block.AddLine(xPoint3, hlLinesL[i].EndPoint, CommonLayer.gz2layer);
                    block.AddLine(xPoint4, hlLinesR[i].EndPoint, CommonLayer.gz2layer);
                }
            }

            //绘制腹板线--纵向
            if (type == BeamLocate.Mid || type == BeamLocate.Right)
            {
                List<Point3d> xPointsUp = new List<Point3d>();
                for (int i = 0; i < hlLinesL.Count; i++)
                {
                    xPointsUp.AddRange(AcadAssist.GetIntersectionPoints(plineUp, hlLinesL[i]));
                    //Point3dCollection curPointsL = new Point3dCollection();
                    //plineUp.IntersectWith(hlLinesL[i], Intersect.OnBothOperands, curPointsL, 0, 0);
                    //for (int j = 0; j < curPointsL.Count; j++)
                    //    xPointsUp.Add(curPointsL[j]);

                    xPointsUp.AddRange(AcadAssist.GetIntersectionPoints(plineUp, hlLinesR[i]));
                    //Point3dCollection curPointsR = new Point3dCollection();
                    //plineUp.IntersectWith(hlLinesR[i], Intersect.OnBothOperands, curPointsR, 0, 0);
                    //for (int j = 0; j < curPointsR.Count; j++)
                    //xPointsUp.Add(curPointsR[j]);
                }
                xPointsUp.Sort(new CompairPoint3dX());
                ////Point3dCollection xPointsUp2 = new Point3dCollection();
                ////for (int i = 0; i < xPointsUp.Count; i++)
                ////{
                ////    xPointsUp2.Add(xPointsUp[i]);
                ////}
                ////DBObjectCollection objCurvesUp = plineUp.GetSplitCurves(xPointsUp2);
                List<TxCurve> objCurvesUp = AcadAssist.SplitCurveByPoints(plineUp, xPointsUp);
                //输出基数个数
                int count1 = Convert.ToInt32((objCurvesUp.Count + 1) / 2);
                for (int i = 0; i < count1; i++)
                {
                    block.AddCurve((TxCurve)objCurvesUp[i * 2], CommonLayer.gz2layer);
                }
            }
            if (type == BeamLocate.Mid || type == BeamLocate.Left)
            {
                //腹板线--右侧侧
                List<Point3d> xPointsDn = new List<Point3d>();
                for (int i = 0; i < hlLinesL.Count; i++)
                {
                    xPointsDn.AddRange(AcadAssist.GetIntersectionPoints(plineUp, hlLinesL[i]));
                    ////Point3dCollection curPointsL = new Point3dCollection();
                    ////plineDn.IntersectWith(hlLinesL[i], Intersect.OnBothOperands, curPointsL, 0, 0);
                    ////for (int j = 0; j < curPointsL.Count; j++)
                    ////    xPointsDn.Add(curPointsL[j]);
                    ////Point3dCollection curPointsR = new Point3dCollection();
                    ////plineDn.IntersectWith(hlLinesR[i], Intersect.OnBothOperands, curPointsR, 0, 0);
                    ////for (int j = 0; j < curPointsR.Count; j++)
                    ////    xPointsDn.Add(curPointsR[j]);
                }
                xPointsDn.Sort(new CompairPoint3dX());
                ////Point3dCollection xPointsDn2 = new Point3dCollection();
                ////for (int i = 0; i < xPointsDn.Count; i++)
                ////{
                ////    xPointsDn2.Add(xPointsDn[i]);
                ////}
                List<TxCurve> objCurvesDn = AcadAssist.SplitCurveByPoints(plineDn, xPointsDn);
                //DBObjectCollection objCurvesDn = plineDn.GetSplitCurves(xPointsDn2);
                //输出基数个数
                int count2 = Convert.ToInt32((objCurvesDn.Count + 1) / 2);
                for (int i = 0; i < count2; i++)
                {
                    block.AddCurve((TxCurve)objCurvesDn[i * 2], CommonLayer.gz2layer);
                }
            }

            if (type == BeamLocate.Left)
                block.AddPolyline(plineUp, CommonLayer.gz2layer);
            if (type == BeamLocate.Right)
                block.AddPolyline(plineDn, CommonLayer.gz2layer);

            //腹板中心线
            TxCurve centerLine = AcadAssist.OffsetLineToBoarder(center2, 0, borderLeft, borderRight);
            block.AddCurve(centerLine, CommonLayer.cenlayer);
            //中心线长度
            Point3d textPoint = center2.GetPointAtDist(center2.Length * 0.4);
            Vector3d textVect = center2.GetFirstDerivative(textPoint);
            //double textAngle = textVect.AngleOnPlane(center2.GetPlane());
            double textAngle = AcadAssist.AngleOnPlan(textVect, center2);
            block.AddText(textPoint, String.Format("中心线长度{0:F0}", center2.Length), block.style.RealTextHeigth * 1000, textAngle, CommonLayer.dimlayer, TxTextHorizontalMode.TextCenter, TxTextVerticalMode.TextBottom);

            //角度标注
            for (int i = 0; i < hlCenters.Count; i++)
            {
                Point3d hlPointx = AcadAssist.GetIntersectionPoint(center2, hlCenters[i]);
                Vector3d curVectx = center2.GetFirstDerivative(hlPointx).GetNormal();
                Vector3d vectHL = hlCenters[i].EndPoint.GetVectorTo(hlCenters[i].StartPoint).GetNormal();
                if (i == hlCenters.Count - 1)
                    block.AddDimAngularFix(hlPointx, hlPointx - curVectx * block.style.BlockScale * 2000, hlPointx + vectHL * block.style.BlockScale * 2000, block.style.DimFirstLayer * 1000);
                else
                    block.AddDimAngularFix(hlPointx, hlPointx + curVectx * block.style.BlockScale * 2000, hlPointx + vectHL * block.style.BlockScale * 2000, block.style.DimFirstLayer * 1000);
            }
        }