Skip to content

Commit

Permalink
Draft: change in default Draft.makeCopy
Browse files Browse the repository at this point in the history
always copy with dependencies when copying App::Part and PartDesign::Body
.
  • Loading branch information
carlopav committed Jan 3, 2021
1 parent 82ec99d commit 79aa9ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mod/Draft/draftmake/make_copy.py
Expand Up @@ -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
Expand Down

0 comments on commit 79aa9ed

Please sign in to comment.