From 3d5d10c4ea740c1132a19f8a466aca5071250c28 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 15 Dec 2019 17:51:43 -0800 Subject: [PATCH 1/2] Fix tag dressup to deal with inactive base operation --- src/Mod/Path/PathScripts/PathDressupHoldingTags.py | 5 ++++- src/Mod/Path/PathScripts/PathGeom.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index cb24e5e393..7cfc2bf7fd 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -552,7 +552,10 @@ class PathData: self.obj = obj self.wire, rapid = PathGeom.wireForPath(obj.Base.Path) self.rapid = _RapidEdges(rapid) - self.edges = self.wire.Edges + if self.wire: + self.edges = self.wire.Edges + else: + self.edges = [] self.baseWire = self.findBottomWire(self.edges) def findBottomWire(self, edges): diff --git a/src/Mod/Path/PathScripts/PathGeom.py b/src/Mod/Path/PathScripts/PathGeom.py index 0415b9238e..335f42fe8b 100644 --- a/src/Mod/Path/PathScripts/PathGeom.py +++ b/src/Mod/Path/PathScripts/PathGeom.py @@ -382,6 +382,8 @@ def wireForPath(path, startPoint = Vector(0, 0, 0)): rapid.append(edge) edges.append(edge) startPoint = commandEndPoint(cmd, startPoint) + if not edges: + return (None, rapid) return (Part.Wire(edges), rapid) def wiresForPath(path, startPoint = Vector(0, 0, 0)): From 5df4bbf2f477a53eb8fef13722c82d9869002f72 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 15 Dec 2019 17:52:05 -0800 Subject: [PATCH 2/2] Added support for dressups to toggle Active state command. --- src/Mod/Path/PathCommands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathCommands.py b/src/Mod/Path/PathCommands.py index 2f85f24572..400072e429 100644 --- a/src/Mod/Path/PathCommands.py +++ b/src/Mod/Path/PathCommands.py @@ -136,13 +136,13 @@ class _ToggleOperation: return False try: obj = FreeCADGui.Selection.getSelectionEx()[0].Object - return isinstance(obj.Proxy, PathScripts.PathOp.ObjectOp) + return isinstance(PathScripts.PathDressup.baseOp(obj).Proxy, PathScripts.PathOp.ObjectOp) except(IndexError, AttributeError): return False def Activated(self): obj = FreeCADGui.Selection.getSelectionEx()[0].Object - obj.Active = not(obj.Active) + PathScripts.PathDressup.baseOp(obj).Active = not(PathScripts.PathDressup.baseOp(obj).Active) FreeCAD.ActiveDocument.recompute()