From 13b5a81bee6a7b5707363dcf904731004a8fafca Mon Sep 17 00:00:00 2001 From: sladro Date: Tue, 23 Dec 2025 19:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=AD=E8=BD=B4?= =?UTF-8?q?=E7=BA=BF=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cad/DrawingStyleManager.cs | 2 +- Cad/FeatureDrivenDrawer.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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);