diff --git a/src/bonsai/bonsai/bim/module/model/workspace.py b/src/bonsai/bonsai/bim/module/model/workspace.py index abe4f45113..8ee17667ed 100644 --- a/src/bonsai/bonsai/bim/module/model/workspace.py +++ b/src/bonsai/bonsai/bim/module/model/workspace.py @@ -1280,7 +1280,22 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator): bpy.ops.bim.extend_profile(join_type="T") else: - bpy.ops.bim.extend_walls_to_underside() + # Extend LAYER2 walls to the underside of another selected element. + # Guard the selection here so an invalid combination (e.g. a column + # and a slab, with no wall involved) reports a clean end-user error + # instead of surfacing the nested operator's ERROR as a developer + # traceback (see #7454). + walls = [ + obj + for obj in bpy.context.selected_objects + if (element := tool.Ifc.get_entity(obj)) and tool.Parametric.is_path_connectable_wall(element) + ] + if walls and len(bpy.context.selected_objects) > len(walls): + bpy.ops.bim.extend_walls_to_underside() + else: + self.report( + {"ERROR"}, "Please select at least one LAYER2 element and at least one other IFC element" + ) def hotkey_S_F(self): if not bpy.context.selected_objects: