BIM: Fixed empty IFC decomposition - fixes #15363

This commit is contained in:
Yorik van Havre
2024-07-16 10:51:22 +02:00
committed by Yorik van Havre
parent de43943fd7
commit 4d29b50ef5

View File

@@ -701,7 +701,10 @@ def filter_elements(elements, ifcfile, expand=True, spaces=False, assemblies=Tru
elements = ifcfile.by_type("IfcElement")
elements.extend(ifcfile.by_type("IfcSite"))
else:
elements = ifcopenshell.util.element.get_decomposition(elem)
decomp = ifcopenshell.util.element.get_decomposition(elem)
if decomp:
# avoid replacing elements if decomp is empty
elements = decomp
else:
if elem.Representation.Representations:
rep = elem.Representation.Representations[0]