From 1a98504328e98fe3bb0d27381b4f5f8201c8f649 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 1 Feb 2025 15:54:57 +1100 Subject: [PATCH] Fix bug and typo where getting shape aspects for non-geometric types (e.g. walls) would fail This caused an error when updating a style of a material used in a wall type --- src/ifcopenshell-python/ifcopenshell/util/element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index fcd350810c..fb7bde9a2d 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -562,8 +562,8 @@ def get_shape_aspects(element: ifcopenshell.entity_instance) -> list[ifcopenshel # IfcTypeProduct shape_aspects = [] - for repersentation_map in element.RepresentationMaps: - shape_aspects += repersentation_map.HasShapeAspects + for representation_map in element.RepresentationMaps or []: + shape_aspects += representation_map.HasShapeAspects return shape_aspects