From 6098d9422354fdb553e38598f403ca58c7e07cbd Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 18 Oct 2022 22:47:42 +1100 Subject: [PATCH] Fix #2507. --- .../ifcopenshell/api/root/create_entity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py index 1fc46f10cb..7abeb59502 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py @@ -62,7 +62,7 @@ class Usecase: def handle_2x3_defaults(self, element): if element.is_a("IfcElement") or element.is_a("IfcElementType"): - if not element.PredefinedType: + if hasattr(element, "PredefinedType") and not element.PredefinedType: element.PredefinedType = "NOTDEFINED" if element.is_a("IfcSpatialStructureElement"): @@ -79,7 +79,7 @@ class Usecase: def handle_4_defaults(self, element): if element.is_a("IfcElement") or element.is_a("IfcElementType"): - if not element.PredefinedType: + if hasattr(element, "PredefinedType") and not element.PredefinedType: element.PredefinedType = "NOTDEFINED" if element.is_a("IfcDoorStyle") or element.is_a("IfcWindowStyle"):