From cfa1428a75e73cfdfcffe689d688785a7bfaec43 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 27 Apr 2022 20:44:26 +1000 Subject: [PATCH] Fix bug where material layer set usage axis was not consistent for non walls --- .../ifcopenshell/api/material/assign_material.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py index 4430c2eb63..70a5040352 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py +++ b/src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py @@ -91,11 +91,23 @@ class Usecase: subelement.SweptArea = profile def create_layer_set_usage(self, material_set): + if self.settings["product"].is_a() in [ + "IfcSlab", + "IfcSlabStandardCase", + "IfcSlabElementedCase", + "IfcRoof", + "IfcRamp", + "IfcPlate", + "IfcPlateStandardCase", + ]: + layer_set_direction = "AXIS3" + else: + layer_set_direction = "AXIS2" return self.file.create_entity( "IfcMaterialLayerSetUsage", **{ "ForLayerSet": material_set, - "LayerSetDirection": "AXIS2" if self.settings["product"].is_a("IfcWall") else "AXIS3", + "LayerSetDirection": layer_set_direction, "DirectionSense": "POSITIVE", "OffsetFromReferenceLine": 0, }