mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
Fix #1462. Standardise IfcOpenShell API to use Pythonic argument names.
This commit is contained in:
@@ -2,14 +2,16 @@ class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"Identification": "APTR",
|
||||
"Name": "Aperture Science",
|
||||
"identification": "APTR",
|
||||
"name": "Aperture Science",
|
||||
}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
if self.file.schema == "IFC2X3":
|
||||
self.settings["Id"] = self.settings["Identification"]
|
||||
del self.settings["Identification"]
|
||||
return self.file.create_entity("IfcOrganization", **self.settings)
|
||||
data = {"Name": self.settings["Name"]}
|
||||
if self.file.schema == "IFC2X3":
|
||||
data["Id"] = self.settings["identification"]
|
||||
else:
|
||||
data["Identification"] = self.settings["identification"]
|
||||
return self.file.create_entity("IfcOrganization", **data)
|
||||
|
||||
Reference in New Issue
Block a user