BIM: fix BuildingPart area calculation for indirect children (#24848)
* BIM: fix BuildingPart area calculation for indirect children Fixes #24667.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user