diff --git a/src/Mod/Path/Path/Op/Gui/Array.py b/src/Mod/Path/Path/Op/Gui/Array.py index 89c09bf220..0031a1adba 100644 --- a/src/Mod/Path/Path/Op/Gui/Array.py +++ b/src/Mod/Path/Path/Op/Gui/Array.py @@ -24,7 +24,7 @@ import FreeCAD import FreeCADGui import Path import PathScripts -from PathScripts.PathUtils import applyPlacementToPath +import PathScripts.PathUtils as PathUtils from Path.Dressup.Utils import toolController from PySide import QtCore import math @@ -349,7 +349,7 @@ class PathArray: for b in base: pl = FreeCAD.Placement() pl.move(pos) - np = Path.Path([cm.transform(pl) for cm in b.Path.Commands]) + np = Path.Path([cm.transform(pl) for cm in PathUtils.getPathWithPlacement(b).Commands]) output += np.toGCode() elif self.arrayType == "Linear2D": @@ -376,7 +376,7 @@ class PathArray: if not (i == 0 and j == 0): pl.move(pos) np = Path.Path( - [cm.transform(pl) for cm in b.Path.Commands] + [cm.transform(pl) for cm in PathUtils.getPathWithPlacement(b).Commands] ) output += np.toGCode() else: @@ -402,7 +402,7 @@ class PathArray: if not (i == 0 and j == 0): pl.move(pos) np = Path.Path( - [cm.transform(pl) for cm in b.Path.Commands] + [cm.transform(pl) for cm in PathUtils.getPathWithPlacement(b).Commands] ) output += np.toGCode() # Eif @@ -415,7 +415,7 @@ class PathArray: pl = FreeCAD.Placement() pl.rotate(self.centre, FreeCAD.Vector(0, 0, 1), ang) - np = applyPlacementToPath(pl, b.Path) + np = PathUtils.applyPlacementToPath(pl, PathUtils.getPathWithPlacement(b)) output += np.toGCode() # return output diff --git a/src/Mod/Path/Path/Op/Gui/Copy.py b/src/Mod/Path/Path/Op/Gui/Copy.py index 939da3c488..001591ba5b 100644 --- a/src/Mod/Path/Path/Op/Gui/Copy.py +++ b/src/Mod/Path/Path/Op/Gui/Copy.py @@ -63,6 +63,8 @@ class ObjectPathCopy: obj.ToolController = obj.Base.ToolController if obj.Base.Path: obj.Path = obj.Base.Path.copy() + if obj.Base.Placement: + obj.Placement = obj.Base.Placement class ViewProviderPathCopy: diff --git a/src/Mod/Path/Path/Op/Gui/SimpleCopy.py b/src/Mod/Path/Path/Op/Gui/SimpleCopy.py index 64f2879108..9edf59a619 100644 --- a/src/Mod/Path/Path/Op/Gui/SimpleCopy.py +++ b/src/Mod/Path/Path/Op/Gui/SimpleCopy.py @@ -68,10 +68,13 @@ class CommandPathSimpleCopy: FreeCAD.ActiveDocument.openTransaction("Simple Copy") FreeCADGui.doCommand( - "srcpath = FreeCADGui.Selection.getSelectionEx()[0].Object.Path\n" + "srcobj = FreeCADGui.Selection.getSelectionEx()[0].Object\n" ) FreeCADGui.addModule("PathScripts.PathUtils") + FreeCADGui.doCommand( + "srcpath = PathScripts.PathUtils.getPathWithPlacement(srcobj)\n" + ) FreeCADGui.addModule("Path.Op.Custom") FreeCADGui.doCommand( 'obj = Path.Op.Custom.Create("' + selection[0].Name + '_SimpleCopy")'