[Closed] Identifying a Selection Set
I’m using a lot of merged components (many multi-object) which on import are assigned to a selectionSet according to their catalog part number (derived from their filename; identical components’ sets are appended with a “_#” to make them unique). I’ve got a component finder script that takes the selected object’s pivot point (which matches a cad block’s default insertion node for the same component), and compares it to the pivot point of each selectionSet, thereby (sometimes) finding the selectionSet (and therefore, the component) to which it belongs, and making that selectionSet the current one. Obviously, the script will sometimes return an erroneous selectionSet when two components have coincident pivot points, depending on their alphabetical order in the selectionSetArray. My question is, is there a better way to determine which selSet a particular object is a member of?
TIA
edit: So far, I think my best bet would be to script an object user properties assigner that I could run on the components files (~3,000 of them) to assign their part numbers, and then use that as another layer of comparison to avoid misidentification…although that still doesn’t avoid expensive looping, and actually increases cost quite a bit, but it does make the script properly functional.