From 9b562669d200494dcb2ffce8546135151ccc3fd4 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 21 May 2024 17:19:33 +0500 Subject: [PATCH] fix root.create_entity skipping setting up defaults on ifc4x3 --- .../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 c1ab6c77e1..c11f0d4d67 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py @@ -105,7 +105,7 @@ class Usecase: element.ObjectType = self.settings["predefined_type"] if self.file.schema == "IFC2X3": self.handle_2x3_defaults(element) - elif self.file.schema == "IFC4": + else: self.handle_4_defaults(element) return element @@ -131,7 +131,7 @@ class Usecase: if hasattr(element, "PredefinedType") and not element.PredefinedType: element.PredefinedType = "NOTDEFINED" - if element.is_a("IfcDoorStyle") or element.is_a("IfcWindowStyle"): + if element.file.schema == "IFC4" and (element.is_a("IfcDoorStyle") or element.is_a("IfcWindowStyle")): element.OperationType = "NOTDEFINED" element.ConstructionType = "NOTDEFINED" element.ParameterTakesPrecedence = False