Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/api/sequence/edit_work_schedule.py
T

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

19 lines
728 B
Python
Raw Normal View History

import ifcopenshell.util.date
2021-04-07 00:31:16 +01:00
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"work_schedule": None, "attributes": {}}
2021-04-07 00:31:16 +01:00
for key, value in settings.items():
self.settings[key] = value
def execute(self):
for name, value in self.settings["attributes"].items():
if value:
if "Date" in name or "Time" in name:
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDateTime")
elif name == "Duration" or name == "TotalFloat":
value = ifcopenshell.util.date.datetime2ifc(value, "IfcDuration")
setattr(self.settings["work_schedule"], name, value)