Found out layer names don't exist in IFC2X3 that's incredible

This commit is contained in:
Dion Moult
2025-02-03 16:04:56 +11:00
parent 0f0578e1c5
commit 50ed756353
@@ -85,7 +85,10 @@ def add_layer(
"""
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(file)
layers = list(layer_set.MaterialLayers or [])
layer = file.create_entity("IfcMaterialLayer", Material=material, LayerThickness=0.1 / unit_scale, Name=name)
if file.schema == "IFC2X3":
layer = file.create_entity("IfcMaterialLayer", Material=material, LayerThickness=0.1 / unit_scale)
else:
layer = file.create_entity("IfcMaterialLayer", Material=material, LayerThickness=0.1 / unit_scale, Name=name)
layers.append(layer)
layer_set.MaterialLayers = layers
return layer