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 836d57e7ff)
This commit is contained in:
Ryan Schultz
2026-03-11 21:39:15 -05:00
committed by Dion Moult
parent a44e27e62e
commit 9c8c159467
+8 -1
View File
@@ -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]