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.

10 lines
375 B
Python
Raw Normal View History

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