Arch: Fixed auto-height of child walls & structures - fixes #5732
This commit is contained in:
@@ -487,14 +487,21 @@ class BuildingPart(ArchIFC.IfcProduct):
|
||||
|
||||
"Touches all descendents where applicable"
|
||||
|
||||
for child in obj.Group:
|
||||
g = []
|
||||
if hasattr(obj,"Group"):
|
||||
g = obj.Group
|
||||
elif (Draft.getType(obj) in ["Wall","Structure"]):
|
||||
g = obj.Additions
|
||||
for child in g:
|
||||
if Draft.getType(child) in ["Wall","Structure"]:
|
||||
if not child.Height.Value:
|
||||
print("Executing ",child.Label)
|
||||
FreeCAD.Console.PrintLog("Auto-updating Height of "+child.Name+"\n")
|
||||
self.touchChildren(child)
|
||||
child.Proxy.execute(child)
|
||||
elif Draft.getType(child) in ["Group","BuildingPart"]:
|
||||
self.touchChildren(child)
|
||||
|
||||
|
||||
def addObject(self,obj,child):
|
||||
|
||||
"Adds an object to the group of this BuildingPart"
|
||||
|
||||
@@ -403,6 +403,11 @@ class Component(ArchIFC.IfcProduct):
|
||||
if hasattr(parent,"Group"):
|
||||
if obj in parent.Group:
|
||||
return self.getParentHeight(parent)
|
||||
# still not found? check if we are embedded
|
||||
for parent in obj.InList:
|
||||
if hasattr(parent,"Additions"):
|
||||
if obj in parent.Additions:
|
||||
return self.getParentHeight(parent)
|
||||
return 0
|
||||
|
||||
def clone(self,obj):
|
||||
|
||||
Reference in New Issue
Block a user