Merge pull request #2784 from mlampert/feature/toggle-active-cmd-support-for-dressups

Path: feature/toggle active cmd support for dressups
This commit is contained in:
sliptonic
2019-12-22 14:15:18 -06:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -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()

View File

@@ -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):

View File

@@ -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)):