diff --git a/src/bonsai/bonsai/bim/module/model/door.py b/src/bonsai/bonsai/bim/module/model/door.py index f04fcd81b7..abd96f7319 100644 --- a/src/bonsai/bonsai/bim/module/model/door.py +++ b/src/bonsai/bonsai/bim/module/model/door.py @@ -478,7 +478,7 @@ def update_door_modifier_bmesh(context: bpy.types.Context) -> None: class BIM_OT_add_door(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "mesh.add_door" - bl_label = "Door" + bl_label = "Add Door" bl_options = {"REGISTER", "UNDO"} @classmethod diff --git a/src/bonsai/bonsai/bim/module/model/stair.py b/src/bonsai/bonsai/bim/module/model/stair.py index 71bfa97a9a..b359153f20 100644 --- a/src/bonsai/bonsai/bim/module/model/stair.py +++ b/src/bonsai/bonsai/bim/module/model/stair.py @@ -131,7 +131,7 @@ def update_ifc_stair_props(obj: bpy.types.Object) -> None: class BIM_OT_add_stair(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "mesh.add_stair" - bl_label = "Stair" + bl_label = "Add Stair" bl_options = {"REGISTER", "UNDO"} @classmethod diff --git a/src/bonsai/bonsai/bim/module/model/window.py b/src/bonsai/bonsai/bim/module/model/window.py index 76471c5ffe..1aebc8cd0b 100644 --- a/src/bonsai/bonsai/bim/module/model/window.py +++ b/src/bonsai/bonsai/bim/module/model/window.py @@ -399,7 +399,7 @@ def update_window_modifier_bmesh(context: bpy.types.Context) -> None: class BIM_OT_add_window(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "mesh.add_window" - bl_label = "Window" + bl_label = "Add Window" bl_options = {"REGISTER", "UNDO"} @classmethod diff --git a/src/bonsai/test/bim/feature/model.feature b/src/bonsai/test/bim/feature/model.feature index 98930639fa..9ca843c1c5 100644 --- a/src/bonsai/test/bim/feature/model.feature +++ b/src/bonsai/test/bim/feature/model.feature @@ -755,3 +755,48 @@ Scenario: Generate a space from cursor location And I press "bim.generate_space" Then the object "IfcSpace/Space" exists And the object "IfcSpace/Space" dimensions are "1,0.8,3" + +Scenario: Add and edit parametric stair + Given an empty IFC project + And I add a cube + And the object "Cube" is selected + And I look at the "Class" panel + And I set the "Products" property to "IfcElement" + And I set the "Class" property to "IfcStairFlight" + And I click "Assign IFC Class" + And I look at the "Stair" panel + And I click "ADD" + And I look at the "Stair" panel + And I click "GREASEPENCIL" + And I look at the "Stair" panel + And I click "CHECKMARK" + +Scenario: Add and edit parametric window + Given an empty IFC project + And I add a cube + And the object "Cube" is selected + And I look at the "Class" panel + And I set the "Products" property to "IfcElement" + And I set the "Class" property to "IfcWindow" + And I click "Assign IFC Class" + And I look at the "BIM_PT_window" panel + And I click "ADD" + And I look at the "BIM_PT_window" panel + And I click "GREASEPENCIL" + And I look at the "BIM_PT_window" panel + And I click "CHECKMARK" + +Scenario: Add and edit parametric door + Given an empty IFC project + And I add a cube + And the object "Cube" is selected + And I look at the "Class" panel + And I set the "Products" property to "IfcElement" + And I set the "Class" property to "IfcDoor" + And I click "Assign IFC Class" + And I look at the "Door" panel + And I click "ADD" + And I look at the "Door" panel + And I click "GREASEPENCIL" + And I look at the "Door" panel + And I click "CHECKMARK" diff --git a/src/bonsai/test/bim/test_feature.py b/src/bonsai/test/bim/test_feature.py index 2da27d5f9a..f8b71ac8a4 100644 --- a/src/bonsai/test/bim/test_feature.py +++ b/src/bonsai/test/bim/test_feature.py @@ -351,13 +351,19 @@ def the_brickschema_is_stubbed(): @given(parsers.parse('I look at the "{panel}" panel')) @when(parsers.parse('I look at the "{panel}" panel')) @then(parsers.parse('I look at the "{panel}" panel')) -def i_look_at_the_panel_panel(panel): - global ui_name_cache +def i_look_at_the_panel_panel(panel: str) -> None: + # Option to provide explicit panel name if panel names overlap. + panel_class = getattr(bpy.types, panel, None) + + if panel_class is None: + global ui_name_cache + create_ui_name_cache() + if panel not in ui_name_cache: + assert False, f"Panel '{panel}' not found in `bpy.types` and in {ui_name_cache}" + panel_class = getattr(bpy.types, ui_name_cache[panel]) + global panel_spy - create_ui_name_cache() - if panel not in ui_name_cache: - assert False, f"Panel {panel} not found in {ui_name_cache}" - panel_spy = PanelSpy(getattr(bpy.types, ui_name_cache[panel])) + panel_spy = PanelSpy(panel_class) panel_spy.refresh_spy()