From ea27b4f3aec7e9583f12ddbbdf24d89f519d6d5e Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Fri, 20 Mar 2026 12:33:51 -0500 Subject: [PATCH] Add ALT+Click unhide to select_similar_type ALT+Click now unhides hidden objects (viewport and local hide) before selecting, matching the behavior added to select_ifc_class and select_similar. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/type/operator.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/type/operator.py b/src/bonsai/bonsai/bim/module/type/operator.py index 4a6ce053fc..868aa0c990 100644 --- a/src/bonsai/bonsai/bim/module/type/operator.py +++ b/src/bonsai/bonsai/bim/module/type/operator.py @@ -221,10 +221,17 @@ class SelectType(bpy.types.Operator): class SelectSimilarType(bpy.types.Operator): + """Select Similar Type\nALT+Click to also unhide hidden objects (viewport and local hide)""" + bl_idname = "bim.select_similar_type" bl_label = "Select Similar Type" bl_options = {"REGISTER", "UNDO"} related_object: bpy.props.StringProperty() + should_unhide: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"}) + + def invoke(self, context, event): + self.should_unhide = event.alt + return self.execute(context) def execute(self, context): self.file = tool.Ifc.get() @@ -246,7 +253,10 @@ class SelectSimilarType(bpy.types.Operator): for element in related_objects: obj = tool.Ifc.get_object(element) - if obj and obj in context.visible_objects: + if obj and (self.should_unhide or obj in context.visible_objects): + if self.should_unhide: + obj.hide_viewport = False + obj.hide_set(False) obj.select_set(True) # copy selection query to clipboard