From e44a9a81aba1feae77ed28f66cfde89867964b07 Mon Sep 17 00:00:00 2001 From: sladro Date: Wed, 31 Dec 2025 10:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B0=BA=E5=AF=B8=E7=BA=BF?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cad/FeatureDrivenDrawer.cs | 2 +- Cad/TemplateDrawingService.cs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cad/FeatureDrivenDrawer.cs b/Cad/FeatureDrivenDrawer.cs index 0314f98..4eae711 100644 --- a/Cad/FeatureDrivenDrawer.cs +++ b/Cad/FeatureDrivenDrawer.cs @@ -1905,7 +1905,7 @@ namespace CadParamPluging.Cad TrySetDimProp(dim, "Dimasz", 2.5); TrySetDimProp(dim, "Dimgap", 1.0); TrySetDimProp(dim, "Dimexe", 1.0); - TrySetDimProp(dim, "Dimexo", 1.0); + TrySetDimProp(dim, "Dimexo", 0.0); // Updated based on user request TrySetDimProp(dim, "Dimtofl", true); // Draw dim line between ext lines diff --git a/Cad/TemplateDrawingService.cs b/Cad/TemplateDrawingService.cs index ce00fec..b6e8f23 100644 --- a/Cad/TemplateDrawingService.cs +++ b/Cad/TemplateDrawingService.cs @@ -1605,7 +1605,12 @@ namespace CadParamPluging.Cad var isBottomEdge = Math.Abs(startPt.Y - layout.MinPoint.Y) < tolerance; if (isTopEdge || isBottomEdge) { - return true; + // 增加长度判断:防止误删位于边界上的短线(如标题栏边框) + // 只有长度超过布局宽度 50% 的线才认为是外框 + if (Math.Abs(startPt.X - endPt.X) > layoutWidth * 0.5) + { + return true; + } } } @@ -1618,7 +1623,11 @@ namespace CadParamPluging.Cad var isRightEdge = Math.Abs(startPt.X - layout.MaxPoint.X) < tolerance; if (isLeftEdge || isRightEdge) { - return true; + // 增加长度判断 + if (Math.Abs(startPt.Y - endPt.Y) > layoutHeight * 0.5) + { + return true; + } } } }