Default material layer thickness for adding new layers

Same as when you create IfcMaterialLayerSet
This commit is contained in:
Andrej730
2023-05-23 16:20:06 +05:00
parent 9b221452d5
commit b66fac5041
@@ -330,7 +330,7 @@ class AddLayer(bpy.types.Operator, tool.Ifc.Operator):
def _execute(self, context):
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
self.file = IfcStore.get_file()
ifcopenshell.api.run(
layer = ifcopenshell.api.run(
"material.add_layer",
self.file,
**{
@@ -339,6 +339,10 @@ class AddLayer(bpy.types.Operator, tool.Ifc.Operator):
},
)
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
thickness = 0.1 # Arbitrary metric thickness for now
layer.LayerThickness = thickness / unit_scale
class ReorderMaterialSetItem(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.reorder_material_set_item"