From f97e7aec3c82a546b36e17d8fb5f4a3967f46f5f Mon Sep 17 00:00:00 2001 From: carlopav Date: Sun, 3 Jan 2021 15:10:29 +0100 Subject: [PATCH] Draft: change in default Draft.makeCopy always copy with dependencies when copying App::Part and PartDesign::Body . --- src/Mod/Draft/draftmake/make_copy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftmake/make_copy.py b/src/Mod/Draft/draftmake/make_copy.py index 9960ed62bd..b1d0662a8b 100644 --- a/src/Mod/Draft/draftmake/make_copy.py +++ b/src/Mod/Draft/draftmake/make_copy.py @@ -59,12 +59,18 @@ def make_copy(obj, force=None, reparent=False, simple_copy=False): newobj = None if simple_copy and hasattr(obj, 'Shape'): + # this was the old implementation that is actyally not used by default _name = utils.get_real_name(obj.Name) newobj = App.ActiveDocument.addObject("Part::Feature", _name) newobj.Shape = obj.Shape gui_utils.format_object(newobj, obj) elif not simple_copy: - newobj = App.ActiveDocument.copyObject(obj) + # this is the new implementation using doc.copyObject API + if obj.hasExtension("App::OriginGroupExtension"): + # always copy with dependencies when copying App::Part and PartDesign::Body + newobj = App.ActiveDocument.copyObject(obj, True) + else: + newobj = App.ActiveDocument.copyObject(obj) if not newobj: return None