Skip to content

Commit 916e1d7

Browse files
committed
Closes #7780 - Add ALT+Click unhide to select_ifc_class
Clear hide_viewport and hide_set on matched objects when the operator is invoked with Alt held, so hidden objects of the target IFC class are revealed and selected. Generated with the assistance of an AI coding tool.
1 parent 8bd3fab commit 916e1d7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/bonsai/bonsai/bim/module/search/operator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,15 +1264,17 @@ def execute(self, context):
12641264

12651265

12661266
class SelectIfcClass(Operator):
1267-
"""Click to select all objects that match with the given IFC class\nSHIFT + Click to also match Predefined Type"""
1267+
"""Click to select all objects that match with the given IFC class\nSHIFT + Click to also match Predefined Type\nALT + Click to also unhide hidden objects (viewport and local hide)"""
12681268

12691269
bl_idname = "bim.select_ifc_class"
12701270
bl_label = "Select IFC Class"
12711271
bl_options = {"REGISTER", "UNDO"}
12721272
should_filter_predefined_type: BoolProperty(default=False)
1273+
should_unhide: BoolProperty(default=False)
12731274

12741275
def invoke(self, context, event):
12751276
self.should_filter_predefined_type = event.shift
1277+
self.should_unhide = event.alt
12761278
return self.execute(context)
12771279

12781280
def execute(self, context):
@@ -1292,6 +1294,9 @@ def execute(self, context):
12921294
):
12931295
continue
12941296
if obj := tool.Ifc.get_object(element):
1297+
if self.should_unhide:
1298+
obj.hide_viewport = False
1299+
obj.hide_set(False)
12951300
tool.Blender.select_object(obj)
12961301

12971302
# copy selection query to clipboard

0 commit comments

Comments
 (0)