Path: Fix creating simple copy

This commit fixes the issue discussed on the FreeCAD forum:

https://forum.freecadweb.org/viewtopic.php?f=15&t=54769
This commit is contained in:
Stefan Mächler
2021-01-25 12:09:17 +01:00
parent f70f9572fe
commit fd2f2d83d0

View File

@@ -67,8 +67,7 @@ class CommandPathSimpleCopy:
FreeCADGui.addModule("PathScripts.PathUtils")
FreeCADGui.addModule("PathScripts.PathCustom")
FreeCADGui.doCommand('obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","' + selection[0].Name + '_SimpleCopy")')
FreeCADGui.doCommand('PathScripts.PathCustom.ObjectCustom(obj)')
FreeCADGui.doCommand('obj = PathScripts.PathCustom.Create("' + selection[0].Name + '_SimpleCopy")')
FreeCADGui.doCommand('obj.ViewObject.Proxy = 0')
FreeCADGui.doCommand('obj.Gcode = [c.toGCode() for c in srcpath.Commands]')
FreeCADGui.doCommand('PathScripts.PathUtils.addToJob(obj)')