Arch: Fixed auto-height of child walls & structures - fixes #5732

This commit is contained in:
Yorik van Havre
2022-03-11 11:52:33 +01:00
parent 87f848a2c1
commit ffbbb4ec9f
2 changed files with 14 additions and 2 deletions

View File

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

View File

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