Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit 23be1a6

Browse files
authored
ifcopenshell.api modules Persons and Organisations account for IFC4 SCHEMA CHANGE (IfcOpenShell#1417)
1 parent 8edced5 commit 23be1a6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ def __init__(self, file, **settings):
99
self.settings[key] = value
1010

1111
def execute(self):
12-
return self.file.create_entity("IfcOrganization", **self.settings)
12+
if self.file.schema == "IFC2X3":
13+
self.settings["Id"] = self.settings["Identification"]
14+
del self.settings["Identification"]
15+
return self.file.create_entity("IfcOrganization", **self.settings)

src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ def __init__(self, file, **settings):
1010
self.settings[key] = value
1111

1212
def execute(self):
13-
return self.file.create_entity("IfcPerson", **self.settings)
13+
if self.file.schema == "IFC2X3":
14+
self.settings["Id"] = self.settings["Identification"]
15+
del self.settings["Identification"]
16+
return self.file.create_entity("IfcPerson", **self.settings)

0 commit comments

Comments
 (0)