From 9c8c159467984b8fb78888ef76afbba9ff91f620 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Wed, 11 Mar 2026 21:39:15 -0500 Subject: [PATCH] Fix #7774: Fix Select Similar failing on pset names with spaces Pset names containing spaces (e.g. "SOLIDWORKS Custom Properties") were not quoted when building selector keys in SelectSimilarData, causing get_element_value to fail when the operator ran. Now wraps pset names and property names in double quotes if they contain spaces, consistent with the selector syntax used elsewhere. Generated with the assistance of an AI coding tool. (cherry picked from commit 836d57e7ff543203a5ed29d8db42be430c0ec99e) --- src/bonsai/bonsai/bim/module/search/data.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/search/data.py b/src/bonsai/bonsai/bim/module/search/data.py index 0a0fd51219..deee7d32a2 100644 --- a/src/bonsai/bonsai/bim/module/search/data.py +++ b/src/bonsai/bonsai/bim/module/search/data.py @@ -132,5 +132,12 @@ class SelectSimilarData: if pset.endswith("Common"): keys.extend([f'/.*Common/."{name}"' for name in properties.keys() if name != "id"]) else: - keys.extend([f"{pset}.{name}" for name in properties.keys() if name != "id"]) + pset_part = f'"{pset}"' if " " in pset else pset + keys.extend( + [ + f'{pset_part}."{name}"' if " " in name else f"{pset_part}.{name}" + for name in properties.keys() + if name != "id" + ] + ) return [(k, k, "") for k in keys]