From 98a25eca960130e8ad8bbdfc937cec7d28080345 Mon Sep 17 00:00:00 2001 From: Petru Conduraru Date: Fri, 17 Jul 2026 07:45:38 +0300 Subject: [PATCH] Bonsai: wire Shift+Q quantity take off hotkey into Spatial tool Fixes #4443. The Wall/Slab/other authoring tools (BimTool subclasses) already bind Shift+Q to bim.perform_quantity_take_off via hotkey_S_Q, but the Spatial tool has its own separate keymap/operator (bim.spatial_hotkey) that never registered a Q entry, forcing users to switch tools just to (re)calculate quantities for a selected element. Added the same Shift+Q keymap entry and a matching hotkey_S_Q handler to the Spatial tool, mirroring BimTool's existing behavior exactly (including the same selected-objects guard). The other part of the request, a bulk "calculate all quantities" entry point, already exists today: bim.perform_quantity_take_off computes quantities for every IfcElement when no objects are selected, exposed via the Scene > Quantity Take-off panel regardless of which workspace tool is active, so no change was needed there. AI-generated, reviewed and tested by BIMvoice. Co-Authored-By: Claude Sonnet 5 --- src/bonsai/bonsai/bim/module/spatial/workspace.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/spatial/workspace.py b/src/bonsai/bonsai/bim/module/spatial/workspace.py index 6f34099861..cd5d02b2bb 100644 --- a/src/bonsai/bonsai/bim/module/spatial/workspace.py +++ b/src/bonsai/bonsai/bim/module/spatial/workspace.py @@ -45,6 +45,7 @@ class SpatialTool(WorkSpaceTool): ("bim.spatial_hotkey", {"type": "T", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_T")]}), ("bim.spatial_hotkey", {"type": "G", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_G")]}), ("bim.spatial_hotkey", {"type": "H", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_H")]}), + ("bim.spatial_hotkey", {"type": "Q", "value": "PRESS", "shift": True}, {"properties": [("hotkey", "S_Q")]}), ) def draw_settings(context, layout, ws_tool): @@ -184,3 +185,9 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator): def hotkey_S_G(self): bpy.ops.bim.generate_space() + + def hotkey_S_Q(self): + # Mirrors BimTool.hotkey_S_Q so quantities can be (re)calculated without switching tools. + if not bpy.context.selected_objects: + return + bpy.ops.bim.perform_quantity_take_off()