BIM: fix BuildingPart area calculation for indirect children (#24848)

* BIM: fix BuildingPart area calculation for indirect children

Fixes #24667.
This commit is contained in:
Roy-043
2026-02-03 20:23:59 +01:00
committed by GitHub
parent c07d248bc3
commit 8657d0a377

View File

@@ -410,14 +410,21 @@ class BuildingPart(ArchIFC.IfcProduct):
def getArea(self, obj):
"computes the area of this floor by adding its inner spaces"
area = 0
if hasattr(obj, "Group"):
for child in obj.Group:
if (Draft.get_type(child) in ["Space", "BuildingPart"]) and hasattr(
child, "IfcType"
):
area += child.Area.Value
return area
def _getArea(obj):
area = 0
if hasattr(obj, "Group"):
for child in obj.Group:
if (
Draft.get_type(child) in ["Space", "BuildingPart"]
and hasattr(child, "IfcType")
and hasattr(child, "Area")
):
area += child.Area.Value
else:
area += _getArea(child)
return area
return _getArea(obj)
def getShapes(self, obj):
"recursively get the shapes of objects inside this BuildingPart"