mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
17 lines
628 B
Python
17 lines
628 B
Python
import ifcopenshell
|
|
|
|
|
|
class Usecase:
|
|
def __init__(self, file, **settings):
|
|
self.file = file
|
|
self.settings = {"constituent_set": None, "material": None}
|
|
for key, value in settings.items():
|
|
self.settings[key] = value
|
|
|
|
def execute(self):
|
|
constituents = list(self.settings["constituent_set"].MaterialConstituents or [])
|
|
constituent = self.file.create_entity("IfcMaterialConstituent", **{"Material": self.settings["material"]})
|
|
constituents.append(constituent)
|
|
self.settings["constituent_set"].MaterialConstituents = constituents
|
|
return constituent
|