From fd2f2d83d05ece79b7883895cc03c31252f9c8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=A4chler?= Date: Mon, 25 Jan 2021 12:09:17 +0100 Subject: [PATCH] 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 --- src/Mod/Path/PathScripts/PathSimpleCopy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSimpleCopy.py b/src/Mod/Path/PathScripts/PathSimpleCopy.py index 2901166801..6c6cb5d5a6 100644 --- a/src/Mod/Path/PathScripts/PathSimpleCopy.py +++ b/src/Mod/Path/PathScripts/PathSimpleCopy.py @@ -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)')