Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/api/unit/add_si_unit.py
T

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

12 lines
445 B
Python
Raw Normal View History

2021-08-13 16:18:05 +10:00
class Usecase:
def __init__(self, file, **settings):
self.file = file
2021-10-04 13:14:38 +11:00
self.settings = {"unit_type": "LENGTHUNIT", "name": "METRE", "prefix": None}
2021-08-13 16:18:05 +10:00
for key, value in settings.items():
self.settings[key] = value
def execute(self):
2021-10-04 13:14:38 +11:00
return self.file.create_entity(
"IfcSIUnit", UnitType=self.settings["unit_type"], Name=self.settings["name"], Prefix=self.settings["prefix"]
)