Material profile set usages are now supported. Hooray! Thanks Jesusbill!

This commit is contained in:
Dion Moult
2021-04-15 18:38:28 +10:00
parent 776c68e2b0
commit 65d0abd072
5 changed files with 39 additions and 10 deletions
@@ -24,18 +24,28 @@ class Usecase:
elif self.settings["type"] == "IfcMaterialProfileSet":
material_set = self.file.create_entity(self.settings["type"])
self.create_material_association(material_set)
elif self.settings["type"] == "IfcMaterialProfileSetUsage":
material_set = self.file.create_entity("IfcMaterialProfileSet")
material_set_usage = self.create_profile_set_usage(material_set)
self.create_material_association(material_set_usage)
elif self.settings["type"] == "IfcMaterialList":
material_set = self.file.create_entity(self.settings["type"])
material_set.Materials = [self.settings["material"]]
self.create_material_association(material_set)
def create_layer_set_usage(self, material_set):
return self.file.create_entity("IfcMaterialLayerSetUsage", **{
"ForLayerSet": material_set,
"LayerSetDirection": "AXIS2" if self.settings["product"].is_a("IfcWall") else "AXIS3",
"DirectionSense": "POSITIVE",
"OffsetFromReferenceLine": 0
})
return self.file.create_entity(
"IfcMaterialLayerSetUsage",
**{
"ForLayerSet": material_set,
"LayerSetDirection": "AXIS2" if self.settings["product"].is_a("IfcWall") else "AXIS3",
"DirectionSense": "POSITIVE",
"OffsetFromReferenceLine": 0,
}
)
def create_profile_set_usage(self, material_set):
return self.file.create_entity("IfcMaterialProfileSetUsage", **{"ForProfileSet": material_set})
def assign_ifc_material(self):
rel = self.get_rel_associates_material(self.settings["material"])