Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/api/material/add_material.py
T

13 lines
357 B
Python
Raw Normal View History

import ifcopenshell
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {"Name": "Unnamed"}
for key, value in settings.items():
self.settings[key] = value
def execute(self):
return self.file.create_entity("IfcMaterial", **{"Name": self.settings["Name"] or "Unnamed"})