Draft: change in default Draft.makeCopy

always copy with dependencies when copying App::Part and PartDesign::Body
.
This commit is contained in:
carlopav
2021-01-03 15:10:29 +01:00
parent e54f4fc086
commit f97e7aec3c

View File

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