From bac683e105977c66f92ead2ff9152a8d3d66a319 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 16 Jun 2023 13:22:01 +1000 Subject: [PATCH] Fix bug for getting psets of materials and profiles in IFC2X3 --- src/ifcopenshell-python/ifcopenshell/util/element.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/element.py b/src/ifcopenshell-python/ifcopenshell/util/element.py index 6f576f893b..23b5b9172e 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/element.py +++ b/src/ifcopenshell-python/ifcopenshell/util/element.py @@ -121,7 +121,7 @@ def get_psets(element, psets_only=False, qtos_only=False, should_inherit=True): continue psets[definition.Name] = get_property_definition(definition) elif element.is_a("IfcMaterialDefinition") or element.is_a("IfcProfileDef"): - for definition in element.HasProperties or []: + for definition in getattr(element, "HasProperties", None) or []: if qtos_only: continue psets[definition.Name] = get_property_definition(definition)