mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
25fb9be82e
* Full support for editing IfcMaterialList added * The reusability of material set relationships are now roundtripped * UI is sensitive to IFC schema version and adapts intelligently
17 lines
625 B
Python
17 lines
625 B
Python
import ifcopenshell
|
|
|
|
|
|
class Usecase:
|
|
def __init__(self, file, settings=None):
|
|
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)
|
|
constituent = self.file.create_entity("IfcMaterialConstituent", **{"Material": self.settings["material"]})
|
|
constituents.append(constituent)
|
|
self.settings["constituent_set"].MaterialConstituents = constituents
|
|
return constituent
|