Draft: Leave all clones selected after cloning

This commit is contained in:
Yorik van Havre
2017-05-21 18:21:01 -03:00
parent 2f467da92a
commit 9179165fcd
2 changed files with 6 additions and 1 deletions

View File

@@ -2956,6 +2956,7 @@ def mirror(objlist,p1,p2):
if len(result) == 1:
result = result[0]
select(result)
return result

View File

@@ -4831,11 +4831,15 @@ class Draft_Clone(Modifier):
if self.call:
self.view.removeEventCallback("SoEvent",self.call)
if FreeCADGui.Selection.getSelection():
l = len(FreeCADGui.Selection.getSelection())
FreeCAD.ActiveDocument.openTransaction("Clone")
for obj in FreeCADGui.Selection.getSelection():
Draft.clone(obj)
FreeCADGui.doCommand("Draft.clone(FreeCAD.ActiveDocument."+obj.Name+")")
FreeCAD.ActiveDocument.commitTransaction()
FreeCAD.ActiveDocument.recompute()
FreeCADGui.Selection.clearSelection()
for i in range(l):
FreeCADGui.Selection.addSelection(FreeCAD.ActiveDocument.Objects[-(1+i)])
self.finish()