/// <summary> /// 绘制梁图 /// </summary> private void DrawBeamSlab() { supportPointsL = new List<Point3d>(); supportPointsR = new List<Point3d>(); //---如果是调试位置,可以打开图块的外边框 IsDrawBlockBorder = true; if (user_curveZX == null || user_cvBoardUp == null || user_cvBoardDn == null || user_pierline1 == null || user_pierline2 == null) { System.Windows.Forms.MessageBox.Show("未选择线。"); return; } xPoint1 = AcadAssist.GetIntersectionPoint(user_curveZX, user_pierline1); xPoint2 = AcadAssist.GetIntersectionPoint(user_curveZX, user_pierline2); Vector3d vectRotate1 = xPoint1.GetVectorTo(xPoint2); //double rotate1Angle = vectRotate1.AngleOnPlane(user_curveZX.GetPlane()); rotate1Angle = AcadAssist.AngleOnPlan(vectRotate1, user_curveZX); curveZX2 = AcadAssist.ConvertToTxPolyline(user_curveZX); cvBoardUp2 = AcadAssist.ConvertToTxPolyline(user_cvBoardUp); cvBoardDn2 = AcadAssist.ConvertToTxPolyline(user_cvBoardDn); pierline12 = (TxLine)user_pierline1.Clone(); pierline22 = (TxLine)user_pierline2.Clone(); curveZX2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1); cvBoardUp2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1); cvBoardDn2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1); pierline12.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1); pierline22.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1); m_storeCLines2 = new List<TxLine>(); for (int i = 0; i < user_storedCLines.Count; i++) { m_storeCLines2.Add((TxLine)user_storedCLines[i].Clone()); m_storeCLines2[i].TransformBy(Matrix3d.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1)); } m_hgbLines2 = new List<TxLine>(); for (int i = 0; i < user_hgbLines.Count; i++) { m_hgbLines2.Add((TxLine)user_hgbLines[i].Clone()); m_hgbLines2[i].TransformBy(Matrix3d.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1)); } if (curveZX2.StartPoint.X > curveZX2.EndPoint.X) curveZX2 = AcadAssist.ReverseTxPolyline(curveZX2); if (cvBoardUp2.StartPoint.X > cvBoardUp2.EndPoint.X) cvBoardUp2 = AcadAssist.ReverseTxPolyline(cvBoardUp2); if (cvBoardDn2.StartPoint.X > cvBoardDn2.EndPoint.X) cvBoardDn2 = AcadAssist.ReverseTxPolyline(cvBoardDn2); if (pierline12.StartPoint.Y > pierline12.EndPoint.Y) pierline12 = AcadAssist.ReverseTxLine(pierline12); if (pierline22.StartPoint.Y > pierline22.EndPoint.Y) pierline22 = AcadAssist.ReverseTxLine(pierline22); try { #region 绘制总体构造信息 [道路设计线,伸缩缝中心线,桩号,墩号,墩位,板梁端部线] //-------------前面还有个中心线的相交-------不相交有没有处理过,是不是已经延长过了,不记得了;这个是新加上的---------- List<Point3d> milePoints1 = AcadAssist.GetIntersectionPoints(curveZX2, pierline12); List<Point3d> milePoints2 = AcadAssist.GetIntersectionPoints(curveZX2, pierline22); if (milePoints1.Count == 0 || milePoints2.Count == 0) System.Windows.Forms.MessageBox.Show("分控线和桥梁边线没有交点"); milePoint1 = AcadAssist.GetIntersectionPoint(curveZX2, pierline12); milePoint2 = AcadAssist.GetIntersectionPoint(curveZX2, pierline22); //伸缩缝中心线线转化为线段 pierline1x = AcadAssist.LineToBorder(pierline12, cvBoardUp2, cvBoardDn2); pierline2x = AcadAssist.LineToBorder(pierline22, cvBoardUp2, cvBoardDn2); //道路设计线 block.AddLine(pierline1x, CommonLayer.cenlayer); block.AddLine(pierline2x, CommonLayer.cenlayer); TxCurve centerLine = AcadAssist.CurveToBorder(curveZX2, pierline12, pierline22); Point3d centerLineMidPoint = centerLine.GetPointAtDist(centerLine.GetDistAtPoint(centerLine.EndPoint) * 0.7); Vector3d centerLineMidVect = AcadAssist.GetFirstDerivative(centerLine, centerLineMidPoint); centerLine = AcadAssist.ExtendCurve(centerLine, 8 * block.style.BlockScale); block.AddCurve(centerLine, CommonLayer.cenlayer); //板梁端部线 [伸缩缝附近横桥向端线] endLine1 = AcadAssist.OffsetLineToBoarder(pierline12, -m_glWidth1 * m_drawScale, cvBoardUp2, cvBoardDn2); endLine2 = AcadAssist.OffsetLineToBoarder(pierline22, +m_glWidth2 * m_drawScale, cvBoardUp2, cvBoardDn2); if (endLine1.StartPoint.Y > endLine1.EndPoint.Y) endLine1 = AcadAssist.ReverseTxLine(endLine1); if (endLine2.StartPoint.Y > endLine2.EndPoint.Y) endLine2 = AcadAssist.ReverseTxLine(endLine2); //空心板横桥向端线 block.AddLine(endLine1, CommonLayer.gz1layer); block.AddLine(endLine2, CommonLayer.gz1layer); //转角---以后对齐,标注等都要用 TxLine alignLine = new TxLine(AcadAssist.Mid(endLine1.StartPoint, endLine1.EndPoint), AcadAssist.Mid(endLine2.StartPoint, endLine2.EndPoint)); Vector3d vectRotate = alignLine.StartPoint.GetVectorTo(alignLine.EndPoint); startLineAngle = AcadAssist.AngleOnPlan(vectRotate, alignLine); #endregion //最外侧板梁边线--------边板悬臂外边线 cvBoardUpx = AcadAssist.CurveToBorder(cvBoardUp2, endLine1, endLine2); cvBoardDnx = AcadAssist.CurveToBorder(cvBoardDn2, endLine1, endLine2); block.AddCurve(cvBoardUpx, CommonLayer.gz1layer); block.AddCurve(cvBoardDnx, CommonLayer.gz1layer); //计算辅助点(去掉悬臂后的空心板边板外侧线的点) // kxb_bb1_point1 kxb_bb1_point2 // ------------------------- // | | // | | // | | // ------------------------- // kxb_bb2_point1 kxb_bb2_point2 #region 初始板梁块数 TxLine borderLineS = new TxLine(cvBoardUpx.StartPoint, cvBoardUpx.EndPoint); TxLine offsetBordS1 = AcadAssist.OffsetLineToBoarder(borderLineS, -m_initWsideLS * m_drawScale, endLine1, endLine2); TxLine offsetBordS2 = AcadAssist.OffsetLineToBoarder(borderLineS, -m_initWsideRS * m_drawScale, endLine1, endLine2); TxLine centerLineS1 = new TxLine(offsetBordS1.StartPoint, offsetBordS2.EndPoint); TxLine borderLineX = new TxLine(cvBoardDnx.StartPoint, cvBoardDnx.EndPoint); TxLine offsetBordX1 = AcadAssist.OffsetLineToBoarder(borderLineX, m_initWsideLX * m_drawScale, endLine1, endLine2); TxLine offsetBordX2 = AcadAssist.OffsetLineToBoarder(borderLineX, m_initWsideRX * m_drawScale, endLine1, endLine2); TxLine centerLineX1 = new TxLine(offsetBordX1.StartPoint, offsetBordX2.EndPoint); double distBorderL = centerLineS1.StartPoint.DistanceTo(centerLineX1.StartPoint); double distBorderR = centerLineS1.EndPoint.DistanceTo(centerLineX1.EndPoint); double Wone = m_initWone * m_drawScale; double Wsum = Math.Min(distBorderL, distBorderR) + Wone; double initWsjf2 = m_initWsjf * m_drawScale; boxCount = AcadAssist.CalBeamCountCombineSjf(Wsum, Wone, initWsjf2, Wone * 0.5); #endregion sideLines = new List<TxLine>(); cenLines = new List<TxLine>(); #region 定义梁中心线 if (drawingMode == DrawingMode.AUTO) { //箱梁划板[按照boxCount*(Wone+sjfW1/2)+Wone的原则] sideLines.Clear(); cenLines.Clear(); List<Point3d> divPointL = AcadAssist.SplitLineByCount(centerLineX1.StartPoint, centerLineS1.StartPoint, boxCount - 1); List<Point3d> divPointR = AcadAssist.SplitLineByCount(centerLineX1.EndPoint, centerLineS1.EndPoint, boxCount - 1); for (int i = 0; i < divPointL.Count; i++) { cenLines.Add(new TxLine(divPointL[i], divPointR[i])); } for (int i = 0; i < cenLines.Count; i++) { sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], -Wone * 0.5, endLine1, endLine2)); sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], +Wone * 0.5, endLine1, endLine2)); } //加上两个边梁d的中心线和内边线 cenLines.Add(centerLineX1); cenLines.Add(centerLineS1); sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineX1, +Wone * 0.5, endLine1, endLine2)); sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineS1, -Wone * 0.5, endLine1, endLine2)); if (isAdjustSJFW) { ///--------求出各湿接缝长度------------------ CompairTxLineStartY compairY1 = new CompairTxLineStartY(); sideLines.Sort(compairY1); cenLines.Sort(compairY1); List<double> sjfWidthBefore1 = new List<double>();//调整前湿接缝左宽度表 List<double> sjfWidthBefore2 = new List<double>();//调整前湿接缝右宽度表 int sjfCount = sideLines.Count / 2;//sidLine是梁边线(除边梁外边线)--数量是(中板数+1)*2==湿接缝数*2 for (int i = 0; i < sjfCount; i++) { double sjfWWW1 = sideLines[i * 2].StartPoint.DistanceTo(sideLines[i * 2 + 1].StartPoint); double sjfWWW2 = sideLines[i * 2].EndPoint.DistanceTo(sideLines[i * 2 + 1].EndPoint); sjfWidthBefore1.Add(sjfWWW1); sjfWidthBefore2.Add(sjfWWW2); } double sjfWidth1Ave = MTL_Math.Math2.sum(sjfWidthBefore1) / sjfWidthBefore1.Count; double sjfWidth2Ave = MTL_Math.Math2.sum(sjfWidthBefore2) / sjfWidthBefore2.Count; List<double> adjustSjfW1 = new List<double>();//湿接缝左宽度调整量表 List<double> adjustSjfW2 = new List<double>();//湿接缝右宽度调整量表 for (int i = 0; i < sjfWidthBefore1.Count - 1; i++) { adjustSjfW1.Add(-(sjfWidthBefore1[i] - sjfWidth1Ave)); adjustSjfW2.Add(-(sjfWidthBefore1[i] - sjfWidth1Ave)); } sideLines.Clear(); cenLines.Clear(); //-----自动均匀调整湿接缝的宽度----------------- List<Point3d> divPointLx = this.AdjustSjfW(centerLineX1.StartPoint, centerLineS1.StartPoint, boxCount - 1, adjustSjfW1); List<Point3d> divPointRx = this.AdjustSjfW(centerLineX1.EndPoint, centerLineS1.EndPoint, boxCount - 1, adjustSjfW2); for (int i = 0; i < divPointL.Count; i++) { cenLines.Add(new TxLine(divPointLx[i], divPointRx[i])); } for (int i = 0; i < cenLines.Count; i++) { sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], -Wone * 0.5, endLine1, endLine2)); sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], +Wone * 0.5, endLine1, endLine2)); } //加上两个边梁d的中心线和内边线 cenLines.Add(centerLineX1); cenLines.Add(centerLineS1); sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineX1, +Wone * 0.5, endLine1, endLine2)); sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineS1, -Wone * 0.5, endLine1, endLine2)); } } else if (drawingMode == DrawingMode.USER_CENTER) { sideLines.Clear(); cenLines.Clear(); for (int i = 0; i < m_storeCLines2.Count; i++) { TxLine tempLine = AcadAssist.LineToBorder(m_storeCLines2[i], endLine1, endLine2); cenLines.Add(tempLine); } CompairTxLineStartY compairY1 = new CompairTxLineStartY(); cenLines.Sort(compairY1); //-----与前面自动确定中心线后形成的梁边线的代码相同-------------- for (int i = 0; i < cenLines.Count; i++) { if (i != 0) { sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], -Wone * 0.5, endLine1, endLine2)); } if (i != cenLines.Count - 1) { sideLines.Add(AcadAssist.OffsetLineToBoarder(cenLines[i], +Wone * 0.5, endLine1, endLine2)); } } //加上两个边梁d的中心线和内边线 //cenLines.Add(centerLineX1); //cenLines.Add(centerLineS1); //sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineX1, +Wone * 0.5, endLine1, endLine2)); //sideLines.Add(AcadAssist.OffsetLineToBoarder(centerLineS1, -Wone * 0.5, endLine1, endLine2)); //-----与前面自动确定中心线后形成的梁边线的代码相同-------------- } else { //箱梁划板[按照文字定义的梁宽和湿接缝宽] sideLines.Clear(); //double offsetX1 = -distX1; //double offsetX2 = -distX2; //List<double> XwidthOffsetL = MTL_Math.ParseString.ParaseToDouble(widthOffsetL); //List<double> XwidthOffsetR = MTL_Math.ParseString.ParaseToDouble(widthOffsetR); //List<double> XwidthOffsetJfL = MTL_Math.ParseString.ParaseToDouble(widthOffsetSjfL); //List<double> XwidthOffsetJfR = MTL_Math.ParseString.ParaseToDouble(widthOffsetSjfR); //if ((XwidthOffsetL.Count != XwidthOffsetR.Count) || (XwidthOffsetL.Count != XwidthOffsetJfL.Count + 1) // || (XwidthOffsetR.Count != XwidthOffsetJfR.Count + 1)) //{ // System.Windows.Forms.MessageBox.Show("板梁个数与湿接缝个数不一致,请修改数据"); // return; //} //for (int i = 0; i < XwidthOffsetL.Count; i++) //{ // double beamWSumLeft = XwidthOffsetL[i]; // double beamWSumRigt = XwidthOffsetR[i]; // //偏移半块板的宽度---求出梁中心线 // double beamWDnLeft = (i == 0) ? (beamWSumLeft - initWsideI2) : ((i == boxCount - 1) ? initWsideI2 : (beamWSumLeft * 0.5)); // double beamWDnRigt = (i == 0) ? (beamWSumRigt - initWsideI2) : ((i == boxCount - 1) ? initWsideI2 : (beamWSumRigt * 0.5)); // TxLine offsetLine1 = AcadAssist.OffsetLineToBoarder(startLine2, (offsetX1 + beamWDnLeft) , endLine1, endLine2); // TxLine offsetLine2 = AcadAssist.OffsetLineToBoarder(startLine2, (offsetX2 + beamWDnRigt) , endLine1, endLine2); // TxLine center1 = new TxLine(offsetLine1.StartPoint, offsetLine2.EndPoint); // if (i != boxCount - 1) // cenLines.Add(center1); // //再偏移半块板的宽度---求出梁上缘边线 // double beamWUpLeft = beamWSumLeft - beamWDnLeft; // double beamWUpRigt = beamWSumRigt - beamWDnRigt; // TxLine offsetLine3 = AcadAssist.OffsetLineToBoarder(startLine2,( offsetX1 + beamWSumLeft ), endLine1, endLine2); // TxLine offsetLine4 = AcadAssist.OffsetLineToBoarder(startLine2, (offsetX2 + beamWSumRigt), endLine1, endLine2); // TxLine border1 = new TxLine(offsetLine3.StartPoint, offsetLine4.EndPoint); // if (i != boxCount - 1) // kxbLines.Add(border1); // offsetX1 += XwidthOffsetL[i]; // offsetX2 += XwidthOffsetR[i]; //} } #endregion //中心线与边线排序 CompairTxLineStartY compareY2 = new CompairTxLineStartY(); sideLines.Sort(compareY2); cenLines.Sort(compareY2); //输出板边线 for (int i = 0; i < sideLines.Count; i++) { block.AddLine(sideLines[i], CommonLayer.gz1layer); } //定义横梁线 List<TxLine> hlLines = new List<TxLine>();//横梁线 if (this.isUserhgbCount == false) { hlLines.AddRange(m_hgbLines2); } else { //-----目前只在跨中加一道横隔板---- TxLine beamSideUpLine1 = new TxLine(cvBoardDnx.StartPoint, cvBoardDnx.EndPoint); TxLine beamSideUpLine2 = new TxLine(cvBoardUpx.StartPoint, cvBoardUpx.EndPoint); Point3d hlPoint1 = AcadAssist.Mid(beamSideUpLine1.StartPoint, beamSideUpLine1.EndPoint); Point3d hlPoint2 = AcadAssist.Mid(beamSideUpLine2.StartPoint, beamSideUpLine2.EndPoint); hlLines.Add(new TxLine(hlPoint1, hlPoint2)); } #region 绘制板梁平面构造图 //绘制小箱梁T梁构造平面[kxbLines不包含上下构造边线--因此要用加上边线的kxbLinesWithBorder] List<BeamBox> BeamBoxs = new List<BeamBox>(); //横向布置箱梁 List<BeamT> beamTs = new List<BeamT>(); //横向布置箱梁 List<TxCurve> kxbLinesWithBorder = new List<TxCurve>(); kxbLinesWithBorder.Insert(0, cvBoardDnx); for (int i = 0; i < sideLines.Count; i++) kxbLinesWithBorder.Add(sideLines[i]); kxbLinesWithBorder.Add(cvBoardUpx); boxCountX = Convert.ToInt32(sideLines.Count / 2); for (int i = 0; i <= boxCountX; i++) { TxLine curBeamCenterLine = cenLines[i]; TxCurve curBeamSideLineDn = kxbLinesWithBorder[i * 2]; TxCurve curBeamSideLineUp = kxbLinesWithBorder[i * 2 + 1]; Point3d beamStartPoint = curBeamCenterLine.StartPoint; if (structType == BeamType.BEAMBOX) { BeamBox BeamBox = new BeamBox(); if (i == 0) BeamBox.type = BeamBase.BeamLocate.Right; if (i == boxCountX) BeamBox.type = BeamBase.BeamLocate.Left; BeamBox.SetLinePM(curBeamCenterLine, curBeamSideLineDn, curBeamSideLineUp, hlLines, m_drawScale); if (isDrawBeam) { DatabaseToAcad blockBeamBox = new DatabaseToAcad(block.style.BlockScale / m_drawScale); BeamBox.DrawPM(blockBeamBox); blockBeamBox.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamBox.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamBox); } else { DatabaseToAcad blockBeamBox = new DatabaseToAcad(block.style.BlockScale / m_drawScale); //BeamBox.DrawCenterLine(blockBeamBox); blockBeamBox.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamBox.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamBox); } BeamBoxs.Add(BeamBox); } else if (structType == BeamType.BEAMT) { BeamT beamT = new BeamT(); if (i == 0) beamT.type = BeamBase.BeamLocate.Right; if (i == boxCountX) beamT.type = BeamBase.BeamLocate.Left; beamT.SetLinePM(curBeamCenterLine, curBeamSideLineDn, curBeamSideLineUp, hlLines, m_drawScale); if (isDrawBeam) { DatabaseToAcad blockBeamT = new DatabaseToAcad(block.style.BlockScale / m_drawScale); beamT.DrawPM(blockBeamT); blockBeamT.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamT.ResetDimensionScale(block.style.BlockScale); //blockBeamT.DimensionScale(m_drawScale); block.Append(blockBeamT); } else { DatabaseToAcad blockBeamT = new DatabaseToAcad(block.style.BlockScale / m_drawScale); //beamT.DrawCenterLine(blockBeamT); beamT.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamT.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamT); } beamTs.Add(beamT); } else { throw new System.Exception("未知上部结构类型。"); } } #endregion #region 湿接缝填充 //桥面板湿接缝填充[kxbLines不包含上下构造边线] int kxbLineCount2 = sideLines.Count / 2; for (int i = 0; i < kxbLineCount2; i++) { TxLine border1 = sideLines[i * 2 + 0]; TxLine border2 = sideLines[i * 2 + 1]; TxPolyline loopPolyline = new TxPolyline(); loopPolyline.AddVertexAt(0, new Point2d(border1.StartPoint.X, border1.StartPoint.Y), 0, 0, 0); loopPolyline.AddVertexAt(0, new Point2d(border1.EndPoint.X, border1.EndPoint.Y), 0, 0, 0); loopPolyline.AddVertexAt(0, new Point2d(border2.EndPoint.X, border2.EndPoint.Y), 0, 0, 0); loopPolyline.AddVertexAt(0, new Point2d(border2.StartPoint.X, border2.StartPoint.Y), 0, 0, 0); loopPolyline.AddVertexAt(0, new Point2d(border1.StartPoint.X, border1.StartPoint.Y), 0, 0, 0); block.AddHatch(loopPolyline, 3 * block.style.BlockScale, CommonLayer.gz3layer); } //桥面板湿接缝填充 #endregion #region 绘制湿接缝范围的横隔板 //湿接缝横梁[START] if (isDrawBeam) { DatabaseToAcad blockSjf = new DatabaseToAcad(block.style.BlockScale); for (int j = 1; j < BeamBoxs.Count; j++) { List<TxLine> hlCenters1 = new List<TxLine>(); List<TxLine> hlLines1L = new List<TxLine>(); List<TxLine> hlLines1R = new List<TxLine>(); BeamBoxs[j - 1].GetHLLine(out hlCenters1, out hlLines1L, out hlLines1R); for (int k = 0; k < hlCenters1.Count; k++) { hlCenters1[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j - 1].StartPointX)); hlLines1L[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j - 1].StartPointX)); hlLines1R[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j - 1].StartPointX)); } List<TxLine> hlCenters2 = new List<TxLine>(); List<TxLine> hlLines2L = new List<TxLine>(); List<TxLine> hlLines2R = new List<TxLine>(); BeamBoxs[j].GetHLLine(out hlCenters2, out hlLines2L, out hlLines2R); for (int k = 0; k < hlCenters1.Count; k++) { hlCenters2[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j].StartPointX)); hlLines2L[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j].StartPointX)); hlLines2R[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, BeamBoxs[j].StartPointX)); } for (int k = 0; k < hlCenters1.Count; k++) { blockSjf.AddLine(new TxLine(hlCenters1[k].EndPoint, hlCenters2[k].StartPoint), CommonLayer.cenlayer); } for (int k = 0; k < hlLines1L.Count; k++) { blockSjf.AddLine(new TxLine(hlLines1L[k].EndPoint, hlLines2L[k].StartPoint), CommonLayer.gz2layer); blockSjf.AddLine(new TxLine(hlLines1R[k].EndPoint, hlLines2R[k].StartPoint), CommonLayer.gz2layer); } } //T梁湿接缝 for (int j = 1; j < beamTs.Count; j++) { List<TxLine> hlCenters1 = new List<TxLine>(); List<TxLine> hlLines1L = new List<TxLine>(); List<TxLine> hlLines1R = new List<TxLine>(); beamTs[j - 1].GetHLLine(out hlCenters1, out hlLines1L, out hlLines1R); for (int k = 0; k < hlCenters1.Count; k++) { hlCenters1[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j - 1].StartPointX)); hlLines1L[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j - 1].StartPointX)); hlLines1R[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j - 1].StartPointX)); } List<TxLine> hlCenters2 = new List<TxLine>(); List<TxLine> hlLines2L = new List<TxLine>(); List<TxLine> hlLines2R = new List<TxLine>(); beamTs[j].GetHLLine(out hlCenters2, out hlLines2L, out hlLines2R); for (int k = 0; k < hlCenters1.Count; k++) { hlCenters2[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j].StartPointX)); hlLines2L[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j].StartPointX)); hlLines2R[k].TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamTs[j].StartPointX)); } for (int k = 0; k < hlCenters1.Count; k++) { blockSjf.AddLine(new TxLine(hlCenters1[k].EndPoint, hlCenters2[k].StartPoint), CommonLayer.cenlayer); } for (int k = 0; k < hlLines1L.Count; k++) { blockSjf.AddLine(new TxLine(hlLines1L[k].EndPoint, hlLines2L[k].StartPoint), CommonLayer.gz2layer); blockSjf.AddLine(new TxLine(hlLines1R[k].EndPoint, hlLines2R[k].StartPoint), CommonLayer.gz2layer); } } block.Append(blockSjf); } //湿接缝横梁[END] #endregion this.isDrawn = true; } catch { System.Windows.Forms.MessageBox.Show("绘图出错,请修改结构定义。" + "可能是结构边线是否合理。"); } }
/// <summary> /// 通图标注,需先绘制梁图 /// </summary> private void DimBeamSlabGeneral() { if (!isDrawn) throw new Exception("尚未绘图"); try { //绘制桩号 block.AddMileStonePlan(milePoint1, curveZX2.GetFirstDerivative(milePoint1)); block.AddMileStonePlan(milePoint2, curveZX2.GetFirstDerivative(milePoint2)); //标注伸缩缝宽度--伸缩缝中心线到空心板边缘顺桥向距离 Point3d dimPoint1 = pierline1x.GetPointAtDist(0); Vector3d dimPillarVect1 = pierline1x.StartPoint.GetVectorTo(pierline1x.EndPoint).GetNormal(); Vector3d dimVect1 = dimPillarVect1.RotateBy(+Math.PI * 0.5, Vector3d.ZAxis); block.AddDimAligned(dimPoint1, dimPoint1 + dimVect1 * m_glWidth1 * m_drawScale, +0.5 * block.style.DimFirstLayer, 0, "s"); Point3d dimPoint2 = pierline2x.GetPointAtDist(0); Vector3d dimPillarVect2 = pierline2x.StartPoint.GetVectorTo(pierline2x.EndPoint).GetNormal(); Vector3d dimVect2 = dimPillarVect2.RotateBy(-Math.PI * 0.5, Vector3d.ZAxis); block.AddDimAligned(dimPoint2, dimPoint2 + dimVect2 * m_glWidth2 * m_drawScale, -0.5 * block.style.DimFirstLayer, 0, "s"); //---墩号标注---[同济院才需要] if (true || CommonSimbel.CompanyLabel.Contains("同济")) { block.AddMileStoneLM_EllipseText(dimPoint1, dimPoint1 - dimPillarVect1.MultiplyBy(2.5 * block.style.DimFirstLayer), "PL", "", ""); block.AddMileStoneLM_EllipseText(dimPoint2, dimPoint2 - dimPillarVect2.MultiplyBy(2.5 * block.style.DimFirstLayer), "PR", "", ""); } //道路设计线 TxCurve centerLine = AcadAssist.CurveToBorder(curveZX2, pierline12, pierline22); Point3d centerLineMidPoint = centerLine.GetPointAtDist(centerLine.GetDistAtPoint(centerLine.EndPoint) * 0.7); Vector3d centerLineMidVect = AcadAssist.GetFirstDerivative(centerLine, centerLineMidPoint); centerLine = AcadAssist.ExtendCurve(centerLine, 8 * block.style.BlockScale); block.AddCurve(centerLine, CommonLayer.cenlayer); block.AddTextDimAngle(centerLineMidPoint, "道路设计中心线", AcadAssist.AngleOnPlan(centerLineMidVect) * 180 / Math.PI + 45, block.style.DimFirstLayer, AcadAssist.AngleOnPlan(centerLineMidVect) * 180 / Math.PI); //转角---以后对齐,标注等都要用 TxLine alignLine = new TxLine(AcadAssist.Mid(endLine1.StartPoint, endLine1.EndPoint), AcadAssist.Mid(endLine2.StartPoint, endLine2.EndPoint)); Vector3d vectRotate = alignLine.StartPoint.GetVectorTo(alignLine.EndPoint); double startLineAngle = AcadAssist.AngleOnPlan(vectRotate, alignLine); //桩号 double startLineAngle360 = startLineAngle * 180 / Math.PI; block.AddTextDimAngle(milePoint1, "分孔线桩号", startLineAngle360 - 135, 2 * block.style.DimFirstLayer, startLineAngle360 + 180); block.AddTextDimAngle(milePoint2, "分孔线桩号", startLineAngle360 - 045, 2 * block.style.DimFirstLayer, startLineAngle360); //前进方向箭头表示 Point3d arrowTextPoint = milePoint2 + Vector3d.XAxis.MultiplyBy(20 * block.style.BlockScale) + Vector3d.XAxis.MultiplyBy(3 * block.style.BlockScale); block.AddDirectText(arrowTextPoint, alignLine.StartPoint.GetVectorTo(alignLine.EndPoint), "桩号前进方向", false); //计算辅助点(去掉悬臂后的空心板边板外侧线的点) // kxb_bb1_point1 kxb_bb1_point2 // ------------------------- // | | // | | // | | // ------------------------- // kxb_bb2_point1 kxb_bb2_point2 ////转角---以后对齐,标注等都要用 //Vector3d vectRotate = m_startLine2.StartPoint.GetVectorTo(m_startLine2.EndPoint); //double startLineAngle = vectRotate.AngleOnPlane(m_startLine2.GetPlane()); //定义横梁线 List<TxLine> hlLines = new List<TxLine>();//横梁线 if (this.isUserhgbCount == false) { hlLines.AddRange(m_hgbLines2); } else { //-----目前只在跨中加一道横隔板---- TxLine beamSideUpLine1 = new TxLine(cvBoardDnx.StartPoint, cvBoardDnx.EndPoint); TxLine beamSideUpLine2 = new TxLine(cvBoardUpx.StartPoint, cvBoardUpx.EndPoint); Point3d hlPoint1 = AcadAssist.Mid(beamSideUpLine1.StartPoint, beamSideUpLine1.EndPoint); Point3d hlPoint2 = AcadAssist.Mid(beamSideUpLine2.StartPoint, beamSideUpLine2.EndPoint); hlLines.Add(new TxLine(hlPoint1, hlPoint2)); } #region 绘制板梁平面构造图 //绘制小箱梁T梁构造平面[kxbLines不包含上下构造边线--因此要用加上边线的kxbLinesWithBorder] List<BeamBox> BeamBoxs = new List<BeamBox>(); //横向布置箱梁 List<BeamT> beamTs = new List<BeamT>(); //横向布置箱梁 List<TxCurve> kxbLinesWithBorder = new List<TxCurve>(); kxbLinesWithBorder.Insert(0, cvBoardDnx); for (int i = 0; i < sideLines.Count; i++) kxbLinesWithBorder.Add(sideLines[i]); kxbLinesWithBorder.Add(cvBoardUpx); int boxCountX = Convert.ToInt32(sideLines.Count / 2); for (int i = 0; i <= boxCountX; i++) { TxLine curBeamCenterLine = cenLines[i]; TxCurve curBeamSideLineDn = kxbLinesWithBorder[i * 2]; TxCurve curBeamSideLineUp = kxbLinesWithBorder[i * 2 + 1]; Point3d beamStartPoint = curBeamCenterLine.StartPoint; if (structType == BeamType.BEAMBOX) { BeamBox BeamBox = new BeamBox(); if (i == 0) BeamBox.type = BeamBase.BeamLocate.Right; if (i == boxCountX) BeamBox.type = BeamBase.BeamLocate.Left; BeamBox.SetLinePM(curBeamCenterLine, curBeamSideLineDn, curBeamSideLineUp, hlLines, m_drawScale); if (isDrawBeam) { DatabaseToAcad blockBeamBox = new DatabaseToAcad(block.style.BlockScale / m_drawScale); BeamBox.DrawPM(blockBeamBox); blockBeamBox.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamBox.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamBox); } else { DatabaseToAcad blockBeamBox = new DatabaseToAcad(block.style.BlockScale / m_drawScale); BeamBox.DrawCenterLine(blockBeamBox); blockBeamBox.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamBox.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamBox); } BeamBoxs.Add(BeamBox); } else if (structType == BeamType.BEAMT) { BeamT beamT = new BeamT(); if (i == 0) beamT.type = BeamBase.BeamLocate.Right; if (i == boxCountX) beamT.type = BeamBase.BeamLocate.Left; beamT.SetLinePM(curBeamCenterLine, curBeamSideLineDn, curBeamSideLineUp, hlLines, m_drawScale); if (isDrawBeam) { DatabaseToAcad blockBeamT = new DatabaseToAcad(block.style.BlockScale / m_drawScale); beamT.DrawPM(blockBeamT); blockBeamT.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamT.ResetDimensionScale(block.style.BlockScale); //blockBeamT.DimensionScale(m_drawScale); block.Append(blockBeamT); } else { DatabaseToAcad blockBeamT = new DatabaseToAcad(block.style.BlockScale / m_drawScale); beamT.DrawCenterLine(blockBeamT); beamT.TransformBy(Matrix3d.Scaling(0.001 * m_drawScale, beamStartPoint)); //-----------原来是这句DimensionScale,现在换成了ResetDimensionScale blockBeamT.ResetDimensionScale(block.style.BlockScale); //blockBeamBox.DimensionScale(m_drawScale); block.Append(blockBeamT); } beamTs.Add(beamT); } else { throw new System.Exception("未知上部结构类型。"); } } //绘制小箱梁T梁构造平面 #endregion #region 标注板梁宽度 ///布板线的长度标注和角度标注, m_glWidth1, m_glWidth2 alignLine2 = new TxLine(AcadAssist.Mid(endLine1.StartPoint, endLine1.EndPoint), AcadAssist.Mid(endLine2.StartPoint, endLine2.EndPoint)); this.DimGeneralBuban(block, endLine1, endLine2, sideLines, alignLine2); #endregion #region 标注悬臂宽度 //cvBoard1 -- 边板悬臂外边线(上侧) //sideBeamXbInside1 -- 边板悬臂根部(上侧) TxLine sideBeamXbInside1 = sideLines[sideLines.Count - 1]; //cvBoard2 -- 边板悬臂外边线(下侧) //sideBeamXbInside2 -- 边板悬臂根部(下侧) TxLine sideBeamXbInside2 = sideLines[0]; //如果桥梁外侧边线是圆弧或多义线则标注悬臂宽度 if (AcadAssist.IsCurveLine(cvBoardUpx) == false && IsDrawDimension == true) { //上边悬臂 //获得下边悬臂线 List<TxCurve> temp_Curve = new List<TxCurve>(); if (structType == BeamType.BEAMBOX) { temp_Curve.AddRange(BeamBoxs[BeamBoxs.Count - 1].GetXuanBiLine(true, true)); //转换为米单位 temp_Curve[0].TransformBy(Matrix3d.Scaling(0.001, BeamBoxs[BeamBoxs.Count - 1].StartPointX));//转换为米单位 temp_Curve[1].TransformBy(Matrix3d.Scaling(0.001, BeamBoxs[BeamBoxs.Count - 1].StartPointX));//转换为米单位 } else if (structType == BeamType.BEAMT) { temp_Curve.AddRange(beamTs[beamTs.Count - 1].GetXuanBiLine(true)); //转换为米单位 temp_Curve[0].TransformBy(Matrix3d.Scaling(0.001, beamTs[beamTs.Count - 1].StartPointX));//转换为米单位 temp_Curve[1].TransformBy(Matrix3d.Scaling(0.001, beamTs[beamTs.Count - 1].StartPointX));//转换为米单位 } TxPolyline temp_cvBoard_outer = AcadAssist.ConvertToTxPolyline(temp_Curve[0]); //(TxCurve)cvBoardUpx.Clone(); TxLine temp_cvBoard_inner = new TxLine(temp_cvBoard_outer.StartPoint, temp_cvBoard_outer.EndPoint); if (IsDimXb_ByBeamCenter) { temp_cvBoard_inner = new TxLine(temp_Curve[1].StartPoint, temp_Curve[1].EndPoint); } ////偏移后标注 TxLine temp_innerLine_forMovePer = AcadAssist.CloneTxLine((TxLine)temp_Curve[1]); //(TxLine)sideBeamXbInside1.Clone(); Vector3d moveVect2 = temp_innerLine_forMovePer.StartPoint.GetVectorTo(temp_innerLine_forMovePer.EndPoint).RotateBy(Math.PI * 0.5, Vector3d.ZAxis).GetNormal(); temp_cvBoard_outer.Displacement(moveVect2.MultiplyBy(dimUpOffset * block.style.DimFirstLayer)); temp_cvBoard_inner.Displacement(moveVect2.MultiplyBy(dimUpOffset * block.style.DimFirstLayer)); temp_innerLine_forMovePer.Displacement(moveVect2.MultiplyBy(dimUpOffset * block.style.DimFirstLayer)); ////标注 this.XuanBiWidth(block, temp_cvBoard_outer, temp_cvBoard_inner); block.AddCurve(temp_cvBoard_outer, CommonLayer.gz1layer); block.AddCurve(temp_cvBoard_inner, CommonLayer.gz1layer); block.AddLine(temp_cvBoard_outer.StartPoint, temp_cvBoard_inner.StartPoint, CommonLayer.dimlayer); block.AddLine(temp_cvBoard_outer.EndPoint, temp_cvBoard_inner.EndPoint, CommonLayer.dimlayer); } if (AcadAssist.IsCurveLine(cvBoardDnx) == false && IsDrawDimension == true) { //下边悬臂 //获得下边悬臂线 List<TxCurve> temp_Curve = new List<TxCurve>(); if (structType == BeamType.BEAMBOX) { temp_Curve.AddRange(BeamBoxs[0].GetXuanBiLine(false, true)); temp_Curve[0].TransformBy(Matrix3d.Scaling(0.001, BeamBoxs[0].StartPointX));//转换为米单位 temp_Curve[1].TransformBy(Matrix3d.Scaling(0.001, BeamBoxs[0].StartPointX));//转换为米单位 } else if (structType == BeamType.BEAMT) { temp_Curve.AddRange(beamTs[0].GetXuanBiLine(false)); temp_Curve[0].TransformBy(Matrix3d.Scaling(0.001, beamTs[0].StartPointX));//转换为米单位 temp_Curve[1].TransformBy(Matrix3d.Scaling(0.001, beamTs[0].StartPointX));//转换为米单位 } TxCurve temp_cvBoard_outer = AcadAssist.CloneTxCurve(temp_Curve[0]); //(TxCurve)cvBoardDnx.Clone(); TxLine temp_cvBoard_inner = new TxLine(temp_cvBoard_outer.StartPoint, temp_cvBoard_outer.EndPoint); if (IsDimXb_ByBeamCenter) { temp_cvBoard_inner = new TxLine(temp_Curve[1].StartPoint, temp_Curve[1].EndPoint); } //偏移后标注 TxLine temp_innerLine_forMovePer = AcadAssist.CloneTxLine((TxLine)temp_Curve[1]); //(TxLine)sideBeamXbInside2.Clone(); Vector3d moveVect = temp_innerLine_forMovePer.StartPoint.GetVectorTo(temp_innerLine_forMovePer.EndPoint).RotateBy(Math.PI * 0.5, Vector3d.ZAxis).GetNormal(); temp_cvBoard_outer.TransformBy(Matrix3d.Displacement(moveVect.MultiplyBy(-dimDownOffset * block.style.DimFirstLayer))); temp_cvBoard_inner.TransformBy(Matrix3d.Displacement(moveVect.MultiplyBy(-dimDownOffset * block.style.DimFirstLayer))); temp_innerLine_forMovePer.TransformBy(Matrix3d.Displacement(moveVect.MultiplyBy(-dimDownOffset * block.style.DimFirstLayer))); //标注 this.XuanBiWidth(block, temp_cvBoard_outer, temp_cvBoard_inner);//this.XuanBiWidth(block, temp_cvBoardExt, temp_insideLine); block.AddCurve(temp_cvBoard_outer, CommonLayer.gz1layer); block.AddCurve(temp_cvBoard_inner, CommonLayer.gz1layer); block.AddLine(temp_cvBoard_outer.StartPoint, temp_cvBoard_inner.StartPoint, CommonLayer.dimlayer); block.AddLine(temp_cvBoard_outer.EndPoint, temp_cvBoard_inner.EndPoint, CommonLayer.dimlayer); } #endregion #region 标注支座 if (IsDrawSupport) { if (isDimItalia == false) { #region 正向标注板梁宽度 //最好再偏移一个斜交角度造成的影响 TxLine startLine2 = AcadAssist.OffsetLineToBoarder(alignLine2, 0, endLine1, endLine2); Point3d pt1 = AcadAssist.ExtendLine(startLine2.EndPoint, startLine2.StartPoint, (m_glWidth2 * this.m_drawScale) + dimSideOffset * block.style.BlockScale - 1 * block.style.DimFirstLayer); Point3d pt2 = AcadAssist.ExtendLine(startLine2.StartPoint, startLine2.EndPoint, (m_glWidth1 * this.m_drawScale) + dimSideOffset * block.style.BlockScale - 1 * block.style.DimFirstLayer); startLine2 = new TxLine(pt1, pt2); Vector3d vectLine = startLine2.StartPoint.GetVectorTo(startLine2.EndPoint); Vector3d vectPer = vectLine.RotateBy(Math.PI * 0.5, Vector3d.ZAxis).GetNormal(); ///----------------支座点加上边界点----- List<Point3d> supportPointsL_Ext = new List<Point3d>();//划板线左侧点 List<Point3d> supportPointsR_Ext = new List<Point3d>();//划板线右侧点 supportPointsL_Ext.AddRange(supportPointsL); supportPointsL_Ext.Add(supportLineL.StartPoint); supportPointsL_Ext.Add(supportLineL.EndPoint); supportPointsR_Ext.AddRange(supportPointsR); supportPointsR_Ext.Add(supportLineR.StartPoint); supportPointsR_Ext.Add(supportLineR.EndPoint); //平移板宽尺寸后点(即标注点) List<Point3d> dim_support_points1 = new List<Point3d>();//划板线左侧点 List<Point3d> dim_support_points2 = new List<Point3d>();//划板线右侧点 for (int i = 0; i < supportPointsL_Ext.Count; i++) { ///----------------计算结构线到中心线的投影垂直距离---再反算出标注点---------- Point3d tempPoint1 = startLine2.GetClosestPointTo(supportPointsL_Ext[i], true);//求出垂足 double dist1 = tempPoint1.DistanceTo(supportPointsL_Ext[i]); Vector3d vect1 = tempPoint1.GetVectorTo(supportPointsL_Ext[i]).GetNormal(); int flag1 = vectPer.IsEqualTo(vect1, new Tolerance(0.01, 0.01)) ? 1 : -1; dim_support_points1.Add(startLine2.StartPoint + flag1 * dist1 * vectPer); } for (int i = 0; i < supportPointsR_Ext.Count; i++) { ///----------------计算结构线到中心线的投影垂直距离---再反算出标注点---------- Point3d tempPoint2 = startLine2.GetClosestPointTo(supportPointsR_Ext[i], true); double dist2 = tempPoint2.DistanceTo(supportPointsR_Ext[i]); Vector3d vect2 = tempPoint2.GetVectorTo(supportPointsR_Ext[i]).GetNormal(); int flag2 = vectPer.IsEqualTo(vect2, new Tolerance(0.01, 0.01)) ? 1 : -1; dim_support_points2.Add(startLine2.EndPoint + flag2 * dist2 * vectPer); } CompairPoint3dY compairY = new CompairPoint3dY(); dim_support_points1.Sort(compairY); dim_support_points2.Sort(compairY); List<Point3d> breakPoint = new List<Point3d>(); block.AddDimToPointsAlignedCombine(dim_support_points1, +block.style.DimFirstLayer, breakPoint, 1000 / m_drawScale); block.AddDimToPointsAlignedCombine(dim_support_points2, -block.style.DimFirstLayer, breakPoint, 1000 / m_drawScale); #endregion } else { #region 斜向标注板梁宽度 //平移板宽尺寸后点(即标注点) List<Point3d> dim_support_points1 = new List<Point3d>();//划板线左侧点 List<Point3d> dim_support_points2 = new List<Point3d>();//划板线右侧点 dim_support_points1.AddRange(supportPointsL); dim_support_points1.Add(supportLineL.StartPoint); dim_support_points1.Add(supportLineL.EndPoint); dim_support_points1.Sort(new CompairPoint3dY()); dim_support_points2.AddRange(supportPointsR); dim_support_points2.Add(supportLineR.StartPoint); dim_support_points2.Add(supportLineR.EndPoint); dim_support_points2.Sort(new CompairPoint3dY()); double dim_support_offset1 = supportOffsetL * 0.001 / m_drawScale; double dim_support_offset2 = supportOffsetR * 0.001 / m_drawScale; List<Point3d> breakPoint = new List<Point3d>(); block.AddDimToPointsAlignedCombine(dim_support_points1, +dim_support_offset1 + block.style.DimFirstLayer, breakPoint, 1000 / m_drawScale, true); block.AddDimToPointsAlignedCombine(dim_support_points2, -dim_support_offset2 - block.style.DimFirstLayer, breakPoint, 1000 / m_drawScale, true); ////左右侧竖向标注 -- 总尺寸标注 //block.AddDimRotated(dim_support_points1[0], dim_support_points1[dim_support_points1.Count - 1], +dim_support_offset1 + block.style.DimSecondLayer, 0, CommonSimbel.ConvertToDimStr(dim_support_points1[0].DistanceTo(dim_support_points1[dim_support_points1.Count - 1]) * 1000 / m_drawScale)); //block.AddDimRotated(dim_support_points2[0], dim_support_points2[dim_support_points2.Count - 1], -dim_support_offset2 - block.style.DimSecondLayer, 0, CommonSimbel.ConvertToDimStr(dim_support_points2[0].DistanceTo(dim_support_points2[dim_support_points2.Count - 1]) * 1000 / m_drawScale)); #endregion } } #endregion } catch { System.Windows.Forms.MessageBox.Show("绘图出错,请修改结构定义。" + "可能是结构边线是否合理。"); } }