mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
You can now add and edit context dependent units including dimensional exponents
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
self.file = file
|
||||
self.settings = {"unit_type": "USERDEFINED", "name": "THINGAMAJIG", "dimensions": (0, 0, 0, 0, 0, 0, 0)}
|
||||
for key, value in settings.items():
|
||||
self.settings[key] = value
|
||||
|
||||
def execute(self):
|
||||
return self.file.create_entity(
|
||||
"IfcContextDependentUnit",
|
||||
Dimensions=self.file.createIfcDimensionalExponents(*self.settings["dimensions"]),
|
||||
UnitType=self.settings["unit_type"],
|
||||
Name=self.settings["name"],
|
||||
)
|
||||
Reference in New Issue
Block a user