From a34730cc34ed9a9f2534507d9850028392b5b363 Mon Sep 17 00:00:00 2001 From: sladro Date: Wed, 21 Jan 2026 15:26:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=E4=BA=86?= =?UTF-8?q?=E6=AF=9B=E6=96=99=E6=80=81/=E8=BD=A7=E5=88=B6/=E7=8E=AF?= =?UTF-8?q?=E5=BD=A2=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cad/FeatureDrivenDrawer.cs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Cad/FeatureDrivenDrawer.cs b/Cad/FeatureDrivenDrawer.cs index d26ce22..e5da4be 100644 --- a/Cad/FeatureDrivenDrawer.cs +++ b/Cad/FeatureDrivenDrawer.cs @@ -705,15 +705,21 @@ namespace CadParamPluging.Cad // === 特征9: 硬度符号 === - var hardnessVal = bag.GetString(KeyHardness); - if (!string.IsNullOrWhiteSpace(hardnessVal)) + // 仅在“毛料态-轧制-环形”模板(applyUnspecifiedFillet=true)中显示 + if (applyUnspecifiedFillet) { - // 指向锻件剖面图的右下角 (白色边框) - // 坐标: xOuterRight, yBottom - double xCorner = ox + visualOuterR; - double yCorner = oy; - - DrawHardnessSymbol(ctx, xCorner, yCorner); + var hardnessVal = bag.GetString(KeyHardness); + if (!string.IsNullOrWhiteSpace(hardnessVal)) + { + // 指向锻件剖面图的底部边框的中间位置 + // 坐标: mid X, yBottom + double xLoopInner = ox + visualInnerR; + double xLoopOuter = ox + visualOuterR; + double xStart = (xLoopInner + xLoopOuter) / 2.0; + double yStart = oy; + + DrawHardnessSymbol(ctx, xStart, yStart); + } } } @@ -2801,10 +2807,8 @@ namespace CadParamPluging.Cad poly.AddVertexAt(2, new Point2d(p3.X, p3.Y), 0, 0, 0); ctx.Style?.Apply(poly, DrawingStyleManager.Role.Dimension); // 使用 Dimension 角色 - // 确保此时是白色(颜色7) 或 按照标注颜色(青色 or Green?) 图片看起来像青色(Cyan)或白色 - // 用户截图看起来是青色/绿色(标注层颜色). Apply logic usually handles layer/color. - // 我们显式设为青色(4)或者跟随标注层 - poly.ColorIndex = 4; + // 用户要求改为绿色 (ColorIndex 3) + poly.ColorIndex = 3; ctx.Btr.AppendEntity(poly); ctx.Tr.AddNewlyCreatedDBObject(poly, true); @@ -2814,7 +2818,7 @@ namespace CadParamPluging.Cad double radius = 4.0; var center = new Point3d(p3.X + radius, p3.Y, 0); var circle = new Circle(center, Vector3d.ZAxis, radius); - circle.ColorIndex = 4; + circle.ColorIndex = 3; ctx.Btr.AppendEntity(circle); ctx.Tr.AddNewlyCreatedDBObject(circle, true); @@ -2823,7 +2827,7 @@ namespace CadParamPluging.Cad var text = new DBText(); text.TextString = "HB"; text.Height = 3.5; - text.ColorIndex = 4; + text.ColorIndex = 3; text.HorizontalMode = TextHorizontalMode.TextCenter; text.VerticalMode = TextVerticalMode.TextVerticalMid; text.AlignmentPoint = center;