diff --git a/src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py index 0953b4a162..1ad8f0cdd0 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py @@ -18,7 +18,12 @@ class Usecase: return rel.RelatingPropertyDefinition pset = self.file.create_entity( - "IfcPropertySet", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]} + "IfcPropertySet", + **{ + "GlobalId": ifcopenshell.guid.new(), + "OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file), + "Name": self.settings["name"], + } ) self.file.create_entity( "IfcRelDefinesByProperties", @@ -36,7 +41,12 @@ class Usecase: return definition pset = self.file.create_entity( - "IfcPropertySet", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]} + "IfcPropertySet", + **{ + "GlobalId": ifcopenshell.guid.new(), + "OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file), + "Name": self.settings["name"], + } ) has_property_sets = list(self.settings["product"].HasPropertySets or []) has_property_sets.append(pset) diff --git a/src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py b/src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py index 5286bd8e53..0bf98d7184 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py @@ -19,7 +19,12 @@ class Usecase: return rel.RelatingPropertyDefinition qto = self.file.create_entity( - "IfcElementQuantity", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]} + "IfcElementQuantity", + **{ + "GlobalId": ifcopenshell.guid.new(), + "OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file), + "Name": self.settings["name"], + } ) self.file.create_entity( "IfcRelDefinesByProperties", diff --git a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py index 1f40d77108..93dc11d907 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/create_entity.py @@ -28,4 +28,12 @@ class Usecase: element.ObjectType = self.settings["predefined_type"] elif hasattr(element, "ObjectType"): element.ObjectType = self.settings["predefined_type"] + if self.file.schema == "IFC2X3": + self.handle_2x3_defaults(element) return element + + def handle_2x3_defaults(self, element): + if element.is_a("IfcSpatialStructureElement"): + element.CompositionType = "ELEMENT" + elif element.is_a("IfcRoof"): + element.ShapeType = "NOTDEFINED"