From 8d54fdc0bcde6e37cbe54c3704f3011114cd84a0 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Thu, 28 Nov 2024 22:38:07 +0100 Subject: [PATCH] Draft: fix handling of Links in TD DraftViews Forum topic: https://forum.freecad.org/viewtopic.php?t=92476 For LinkGroups and Links to Std_Groups that do not have a default placement, a temporary hidden document is used to handle the placement of their children. This is a bit of a hack of course. --- src/Mod/Draft/draftfunctions/svg.py | 161 ++++++++++++++++++---------- 1 file changed, 105 insertions(+), 56 deletions(-) diff --git a/src/Mod/Draft/draftfunctions/svg.py b/src/Mod/Draft/draftfunctions/svg.py index 2b30ccb55b..c2137cf1a3 100644 --- a/src/Mod/Draft/draftfunctions/svg.py +++ b/src/Mod/Draft/draftfunctions/svg.py @@ -103,8 +103,9 @@ def get_arrow(obj, arrowtype, point, arrowsize, color, linewidth, angle=0): """Get the SVG representation from an arrow.""" svg = "" + vobj = _get_view_object(obj) - if not App.GuiUp or not obj.ViewObject: + if not App.GuiUp or vobj is None: return svg _cx_cy_r = 'cx="{}" cy="{}" r="{}"'.format(point.x, point.y, arrowsize) @@ -114,7 +115,7 @@ def get_arrow(obj, _scale = 'scale({size},{size})'.format(size=arrowsize) _style = 'style="stroke-miterlimit:4;stroke-dasharray:none;stroke-linecap:square"' - if obj.ViewObject.ArrowType == "Circle": + if vobj.ArrowType == "Circle": svg += '