Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/api/attribute/edit_attributes.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
649 B
Python
Raw Normal View History

import ifcopenshell.api.owner.update_owner_history as update_owner_history
class Usecase():
2021-03-25 00:54:42 +01:00
def __init__(self, file, settings={}):
self.file = file
self.settings = {
"product": None,
"attributes": {}
}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
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()