From 23be1a693931102c8541532daf83cebb617df938 Mon Sep 17 00:00:00 2001 From: Sigma Dimensions <79010126+myoualid@users.noreply.github.com> Date: Tue, 6 Apr 2021 23:28:02 +0100 Subject: [PATCH] ifcopenshell.api modules Persons and Organisations account for IFC4 SCHEMA CHANGE (#1417) --- .../ifcopenshell/api/owner/add_organisation.py | 5 ++++- src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py index 6635fdcb8a..8e5583f0c3 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py @@ -9,4 +9,7 @@ class Usecase: self.settings[key] = value def execute(self): - return self.file.create_entity("IfcOrganization", **self.settings) + if self.file.schema == "IFC2X3": + self.settings["Id"] = self.settings["Identification"] + del self.settings["Identification"] + return self.file.create_entity("IfcOrganization", **self.settings) \ No newline at end of file diff --git a/src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py index f136af8d16..d19e98adfe 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py +++ b/src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py @@ -10,4 +10,7 @@ class Usecase: self.settings[key] = value def execute(self): - return self.file.create_entity("IfcPerson", **self.settings) + if self.file.schema == "IFC2X3": + self.settings["Id"] = self.settings["Identification"] + del self.settings["Identification"] + return self.file.create_entity("IfcPerson", **self.settings) \ No newline at end of file