diff --git a/Cad/DrawingStyleManager.cs b/Cad/DrawingStyleManager.cs index 6e75af6..8ed402f 100644 --- a/Cad/DrawingStyleManager.cs +++ b/Cad/DrawingStyleManager.cs @@ -59,7 +59,7 @@ namespace CadParamPluging.Cad case Role.PartContour: return new LayerSpec { LayerName = "双点划线", DefaultLinetypeName = "PHANTOM", DefaultLineWeight = LineWeight.LineWeight015, DefaultColorIndex = 7 }; case Role.Centerline: - return new LayerSpec { LayerName = "中心线", DefaultLinetypeName = "Continuous", DefaultLineWeight = LineWeight.LineWeight015, DefaultColorIndex = 7 }; + return new LayerSpec { LayerName = "中心线", DefaultLinetypeName = "CENTER", DefaultLineWeight = LineWeight.LineWeight015, DefaultColorIndex = 7 }; case Role.Hidden: return new LayerSpec { LayerName = "虚线", DefaultLinetypeName = "DASHED", DefaultLineWeight = LineWeight.LineWeight025, DefaultColorIndex = 7 }; case Role.Hatch: diff --git a/Cad/FeatureDrivenDrawer.cs b/Cad/FeatureDrivenDrawer.cs index 7586c5d..5495c94 100644 --- a/Cad/FeatureDrivenDrawer.cs +++ b/Cad/FeatureDrivenDrawer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Geometry; using CadParamPluging.Common; @@ -573,7 +574,11 @@ namespace CadParamPluging.Cad /// private static void DrawRingSymmetryAxis(DrawingContext ctx, double ox, double oy, double height) { - var line = new Line(new Point3d(ox, oy - 10, 0), new Point3d(ox, oy + height + 10, 0)); + // 直接使用“高度标注”的两端点(锻件外轮廓的上下边),不做上下延长,避免越过图框上边界。 + var y0 = oy; + var y1 = oy + height; + + var line = new Line(new Point3d(ox, y0, 0), new Point3d(ox, y1, 0)); ctx.Style?.Apply(line, DrawingStyleManager.Role.Centerline); ctx.Btr.AppendEntity(line); ctx.Tr.AddNewlyCreatedDBObject(line, true);