mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
New ifcopenshell.api.run syntax, and rename create_product to create_entity. See #1399.
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import ifcopenshell.api.owner.update_owner_history as update_owner_history
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
class Usecase():
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
self.file = file
|
||||
self.settings = {
|
||||
"product": None,
|
||||
"attributes": {}
|
||||
}
|
||||
self.settings = {"product": None, "attributes": {}}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
@@ -15,4 +12,4 @@ class Usecase():
|
||||
for name, value in self.settings["attributes"].items():
|
||||
setattr(self.settings["product"], name, value)
|
||||
if hasattr(self.settings["product"], "OwnerHistory"):
|
||||
update_owner_history.Usecase(self.file, {"element": self.settings["product"]}).execute()
|
||||
ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": self.settings["product"]})
|
||||
|
||||
Reference in New Issue
Block a user