get_elements_by_style to support curve styles used in IfcFillAreaStyleHatching

This commit is contained in:
Andrej730
2024-10-01 11:36:25 +05:00
parent 55726b3d50
commit e040dc4562
2 changed files with 23 additions and 0 deletions
@@ -764,10 +764,15 @@ def get_elements_by_style(
style = file.by_type("IfcSurfaceStyle")[0]
elements = ifcopenshell.util.element.get_elements_by_style(file, style)
"""
is_curve_style = style.is_a("IfcCurveStyle")
results = set()
inverses = list(ifc_file.get_inverse(style))
while inverses:
inverse = inverses.pop()
inverse_class = inverse.is_a()
if is_curve_style and inverse_class in ("IfcFillAreaStyleHatching", "IfcFillAreaStyle"):
inverses.extend(ifc_file.get_inverse(inverse))
continue
if inverse.is_a("IfcPresentationStyleAssignment"):
inverses.extend(ifc_file.get_inverse(inverse))
continue