Arch/Draft: Autoselect results of Up/downgrade and arch component

This commit is contained in:
Yorik van Havre
2017-04-06 18:08:39 -03:00
parent 3f9aead061
commit 744a9b3590
2 changed files with 7 additions and 0 deletions

View File

@@ -211,6 +211,7 @@ def makeComponent(baseobj=None,name="Component",delete=False):
baseobj.ViewObject.hide()
elif isinstance(baseobj,Part.Shape):
obj.Shape = baseobj
Draft.select(obj)
return obj
def cloneComponent(obj):
@@ -225,6 +226,8 @@ def cloneComponent(obj):
if hasattr(obj,"IfcAttributes"):
if obj.IfcAttributes:
c.IfcAttributes = obj.IfcAttributes
Draft.select(c)
return c
def setAsSubcomponent(obj):
'''Sets the given object properly to become a subcomponent (addition, subtraction)

View File

@@ -2869,6 +2869,7 @@ def clone(obj,delta=None,forcedraft=False):
cl.Tag = base.Tag
except:
pass
select(cl)
return cl
else:
cl = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Clone")
@@ -2883,6 +2884,7 @@ def clone(obj,delta=None,forcedraft=False):
elif len(obj) == 1:
cl.Placement = obj[0].Placement
formatObject(cl,obj[0])
select(cl)
return cl
def getCloneBase(obj,strict=False):
@@ -3375,6 +3377,7 @@ def upgrade(objects,delete=False,force=None):
deleteList = []
for n in names:
FreeCAD.ActiveDocument.removeObject(n)
select(addList)
return [addList,deleteList]
def downgrade(objects,delete=False,force=None):
@@ -3575,6 +3578,7 @@ def downgrade(objects,delete=False,force=None):
deleteList = []
for n in names:
FreeCAD.ActiveDocument.removeObject(n)
select(addList)
return [addList,deleteList]