diff --git a/src/bonsai/bonsai/bim/module/model/slab.py b/src/bonsai/bonsai/bim/module/model/slab.py index 7630ef258c..3dcbf2aef0 100644 --- a/src/bonsai/bonsai/bim/module/model/slab.py +++ b/src/bonsai/bonsai/bim/module/model/slab.py @@ -249,6 +249,7 @@ class DumbSlabPlaner: self.change_thickness(element, total_thickness) def change_thickness(self, element: ifcopenshell.entity_instance, thickness: float) -> None: + self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) if tool.Model.get_usage_type(element) != "LAYER3": return layer_params = tool.Model.get_material_layer_parameters(element) diff --git a/src/bonsai/test/bim/feature/type.feature b/src/bonsai/test/bim/feature/type.feature index 1efefef446..9bae601b30 100644 --- a/src/bonsai/test/bim/feature/type.feature +++ b/src/bonsai/test/bim/feature/type.feature @@ -110,7 +110,7 @@ Scenario: Assign type - assign to a type with a material layer set, which automa And the object "IfcWall/Unnamed" has a "100" thick layered material containing the material "Default" And the object "IfcWall/Unnamed" dimensions are ".5,.1,.5" -Scenario: Assign type - assign to a different type with a material layer set +Scenario: Assign type - assign to a different type with a LAYER2 material layer set Given an empty IFC project And I add a cube And the object "Cube" is selected @@ -149,6 +149,23 @@ Scenario: Assign type - assign to a different type with a material layer set Then the object "IfcWall/Cube" has a "200" thick layered material containing the material "Default" And the object "IfcWall/Cube" dimensions are "1,.2,1" +Scenario: Assign type - assign to a different type with a LAYER3 material layer set + Given an empty IFC project + And I load the demo construction library + And I set "scene.BIMModelProperties.ifc_class" to "IfcSlabType" + And the variable "element_type" is "[e for e in {ifc}.by_type('IfcSlabType') if e.Name == 'FLR200'][0].id()" + And I set "scene.BIMModelProperties.relating_type_id" to "{element_type}" + When I press "bim.add_occurrence" + Then the object "IfcSlab/Slab" is an "IfcSlab" + And the object "IfcSlab/Slab" dimensions are "1,1,0.2" + And the object "IfcSlab/Slab" bottom left corner is at "0,0,0" + And the object "IfcSlab/Slab" top right corner is at "1,1,0.2" + When I look at the "Type" panel + And I click "GREASEPENCIL" + And I set the "relating_type" property to "FLR300" + And I click "CHECKMARK" + Then the object "IfcSlab/Slab" dimensions are "1,1,0.3" + Scenario: Assign type - assign to a type with a material profile set Given an empty IFC project And I add a cube