mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 23:27:54 +00:00
Default material layer thickness for adding new layers
Same as when you create IfcMaterialLayerSet
This commit is contained in:
@@ -330,7 +330,7 @@ class AddLayer(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
ifcopenshell.api.run(
|
layer = ifcopenshell.api.run(
|
||||||
"material.add_layer",
|
"material.add_layer",
|
||||||
self.file,
|
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):
|
class ReorderMaterialSetItem(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
bl_idname = "bim.reorder_material_set_item"
|
bl_idname = "bim.reorder_material_set_item"
|
||||||
|
|||||||
Reference in New Issue
Block a user