diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..cfbf1c6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*.cs] +charset = utf-8-bom diff --git a/Cad/Drawers/ShaftRawFreeForgeSquareShaftGenerator.cs b/Cad/Drawers/ShaftRawFreeForgeSquareShaftGenerator.cs index 165fade..35a3e57 100644 --- a/Cad/Drawers/ShaftRawFreeForgeSquareShaftGenerator.cs +++ b/Cad/Drawers/ShaftRawFreeForgeSquareShaftGenerator.cs @@ -38,7 +38,9 @@ namespace CadParamPluging.Cad public void Draw(CadContext ctx, ParamBag bag, TemplateParams templateParams, Point3d center, double scaleFactor) { + System.Diagnostics.Debug.WriteLine($"[SquareShaftGenerator] Draw() 被调用,准备调用 Drawer"); ShaftRawFreeForgeSquareShaftDrawer.Draw(ctx, bag, center, scaleFactor); + System.Diagnostics.Debug.WriteLine($"[SquareShaftGenerator] Drawer 调用完成"); } } } diff --git a/Cad/ShaftRawFreeForgeSquareShaftDrawer.cs b/Cad/ShaftRawFreeForgeSquareShaftDrawer.cs index 562ef66..c8079e4 100644 Binary files a/Cad/ShaftRawFreeForgeSquareShaftDrawer.cs and b/Cad/ShaftRawFreeForgeSquareShaftDrawer.cs differ diff --git a/UI/ParamDrawingPanel.cs b/UI/ParamDrawingPanel.cs index dcac0b2..49eb66c 100644 --- a/UI/ParamDrawingPanel.cs +++ b/UI/ParamDrawingPanel.cs @@ -236,6 +236,9 @@ namespace CadParamPluging.UI AppendLog($"未找到该模板的图纸生成逻辑(TemplateKey={templateKey})。请先实现对应模板生成器。"); return; } + + // 调试日志:显示找到的生成器类型 + AppendLog($"[调试] 已找到生成器: {generator.GetType().Name}, TemplateKey={templateKey}"); var catalog = ParamCatalogStore.Load(); CadParamPluging.Common.ParamBag bag; @@ -442,14 +445,19 @@ namespace CadParamPluging.UI // Let's just log specific keys we suspect. AppendLog($"Bag Keys check: OD1={bag.GetDoubleOrNull("OuterDiameter1")}, H1={bag.GetDoubleOrNull("Height1")}"); + // 方轴参数检查 + AppendLog($"[方轴参数] Size1={bag.GetDoubleOrNull("SquareShaftSize1")}, Size2={bag.GetDoubleOrNull("SquareShaftSize2")}, Size3={bag.GetDoubleOrNull("SquareShaftSize3")}"); + // 根据模板参数绘制半剖视图,居中放置于原图纸位置 // 使用特征驱动模式:根据参数存在性动态绘制对应特征 + AppendLog($"[绘图] 准备调用 generator.Draw, scaleFactor={scaleFactor}"); generator.Draw( ctx, bag, tplParams, removeResult.OriginalCenter, scaleFactor); + AppendLog($"[绘图] generator.Draw 调用完成"); // Force Zoom Extents to ensure visibility try { doc.SendStringToExecute("._ZOOM _E ", true, false, false); } catch { }