Minor fix. See #1616.

This commit is contained in:
Dion Moult
2021-08-08 20:24:44 +10:00
parent 2c66fbf1c4
commit b696d302f9
2 changed files with 12 additions and 12 deletions
+4 -5
View File
@@ -1,6 +1,5 @@
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
class LibraryGenerator:
@@ -66,16 +65,16 @@ class LibraryGenerator:
def create_layer_type(self, ifc_class, name, thickness):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class=ifc_class, name=name)
ifcopenshell.api.run("material.assign_material", self.file, product=element, type="IfcMaterialLayerSet")
layer_set = ifcopenshell.util.element.get_material(element)
rel = ifcopenshell.api.run("material.assign_material", self.file, product=element, type="IfcMaterialLayerSet")
layer_set = rel.RelatingMaterial
layer = ifcopenshell.api.run("material.add_layer", self.file, layer_set=layer_set, material=self.material)
layer.LayerThickness = thickness
ifcopenshell.api.run("project.assign_declaration", self.file, definition=element, relating_context=self.project)
def create_profile_type(self, ifc_class, name, profile):
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class=ifc_class, name=name)
ifcopenshell.api.run("material.assign_material", self.file, product=element, type="IfcMaterialProfileSet")
profile_set = ifcopenshell.util.element.get_material(element)
rel = ifcopenshell.api.run("material.assign_material", self.file, product=element, type="IfcMaterialProfileSet")
profile_set = rel.RelatingMaterial
material_profile = ifcopenshell.api.run(
"material.add_profile", self.file, profile_set=profile_set, material=self.material
)