I am wondering if there’s a way to do the following. When theres a complex array of varying geometry, sometimes I need to isolate a specific selection based on layer.
Is there a way to run a command which asks you to select some objects, then press enter. Rhino now knows that you only want the future selection to be from those layers of the previously selected geometry.
That means, I can have a large array of random objects, but when I do selection commands, it will only add objects that are on the layers of the objects which were previously selected during that command.
Is there something like this? Not sure if this makes sense
I’m not sure that’s exactly what I mean, was hard to word it clearly.
I imagined something like:
Turn ‘filter’ on. It then asks you for the layers of your desired selection. To find these layers, you select either the layers themselves, but preferably, the objects themselves; and then the layers are determined from this. Now it has those layers, future selections are locked to those layers until it’s turned off.
Perhaps it was better worded as constrain selection to layers of selected objects
One way I can think about this (as a potential scripted tool) is that once you define your “Filtered” layers set (whether from selected objects or Layers panel selection), there would be a script that unselects all objects that are on layers not belonging to your “Filtered” group.
But it would require running the script (from a button or alias) every time you want it filtered.
Perhaps there is a way in Python to merge this idea with some selection event watcher, but that’s above my head…
The first script will let you define the filtered layers, either from selected objects or layers in layer panel (or both). Once this is defined, the second script will always deselect everything from layers NOT defined in the first script.
I guess you can add these to some aliases or buttons for quick access if that helps and if you want a separate filter from selected objects, layers or both.
It still requires extra click to execute the filter, vs locking layers solution, but this is the closest I can think of with relatively simple scripts.
Finally got around to testing these scripts. They work but seem to not work with complex layer hierarchies.
The easiest workaround is to select all objects on that layer, Isolate or isolate lock, then select, then unisolate.