Selection History

Hi all,

I have been thinking this for a while.
We know that the '_Selprev command can help us to get the previous selection set.
But if we want to get the selection set before the previous one how can we do it?
Is there any command or file records the history of selection set (since the 3dm file been open)?
So we can just easily pick up the previous-previous or previous-previous-previous selection?

Thanks for any suggestions,



I want that too.

Hi Jack- there is no way that I know of to do this now… can you tell me what you would do with this?



I’d use it for macros. In that case, if you’re not using named objects, then an object name can be used to recall selection sets, but it’s kind of a pain.

Also, sometimes I just want to go back and select the objects I selected the time before last or the time before that. Probably wouldn’t need to go any further back than that IMO.

Hi Hans- this is not a real answer to the original request but… I guess of your macros are that complex, you really might be better off scripting.


But then I have to learn stuff, and I’m scared. I do realize that this is in my future, however. Where do I get started, Pascal?

Hi Hans-

RhinoScript -

Python - probably more like the future

Also -


Ok thanks Pascal, it was that fork between RhinoScript and Python that was spooking me. I’ll start working on stuff to make life easier instead of just wishing for them.

Hi Hans,

Could you explain more detail about how to achieve it by using Macros?



Hi pascal,

I am just thinking it would be great if we don’t need to go back and pick every object in the prev-prev selection…

Is it possible using Python to achieve it?
Say, when you open a file, you run a python script at the backstage, then it can automatically record / update the last 5~10 selection sets when you are modeling. It can store the ids of previous selection sets…

I understand the selection set is quite dynamic… whenever you pick one more object you change the selection sets (probably need to ask python to automatically record the selection sets every 10 seconds).

Any suggestions?


Hi Jack, try it like this:

_SetObjectName selection
…do a bunch of stuff…
_-SelName selection
_SetObjectName null

That will leave you with your original pre-selected set at the end of the macro.

Hi Hans,

Thanks for your reply.
But I am thinking how to do it without pre-setting.
So it can be similar to the ‘Selprev’ command. Your selection set is changing all the time as your manually modeling progress, it is more flexible…It also allows one object belongs to multiple selection sets.

Hi @pascal,
having an own undo/redo stack for selections isn’t an uncommon concept in mesh modelling. I use this for temporarary selection sets, which are not worth getting named and saved. In the gif I can quickly cycle backwards and forward through selection states and go on editing, without having to reselect manually.

1 Like

Yes, I could see this as an addition (plug-in or native?), just something that collects lists of GUIDs and saves out that list every time the selection is changed. It might add some overhead and slow things down if there are thousands of objects. You could choose to allocate a certain amount of memory to it or a max number of states preferably.

If some of the objects in various sets are later deleted, it can just select what’s left of the GUIDs that it finds. Of course, if you don’t name these things systematically, it’s going to be hard to find what you want if it’s very far down in the stack. More than 10 or so is probably too much already. That’s why specifically naming selection sets is useful.

Named selection sets could also be part of the document info, to be retrieved even after the document has been closed and re-opened.


For interactive editing the last 5 to max 10 states were plenty enough I guess. Cycling through the stack shouldn’t take longer than manual reselection :o).

Of course having something run automagically in the background would be great. Scripting it doesn’t seem too far-fetched, but I’m still only on section 3.3 of the Python manual and I’ve got other fish to fry.

For now, if you know in advance you’ll want to re-select something, you could make a series of buttons that contain scripts like:

on the left click:
_SetObjectName selection1

and on the right click:
_-SelName selection1

and then a button to clear a selection set (after selecting it with one of the right clicks):
_SetObjectName null

That would allow you to save as many selection sets as you wanted to make buttons for.

BTW I understand that’s not what you’re asking for.

In a script, I think keeping track of everything selected before a non-selection command would help with not creating separate selection sets every time you select an individual item. So in other words, selecting five objects one-by-one and then performing a translation on them wouldn’t create five different selection sets, it would only create one that would get updated each time a new object is selected until the translate command occurs, at which point it would switch to a new running selection set.

Maybe this can help you:

SaveSelection.rhp (21 KB)

2 commands:


First select your objects then SelectionSave. A popup will come up for a name.
After this you can do what you want, add more selections etc.

If you want to get the old selection. Go for SelectionLoad. Select the name in the popup and press ok.
And your back to your old selection :slight_smile:

If you close your rhino files the saves will be lost.

Selection sets are one thing, and very useful - and I think what the user is asking is not this though, correct? It is the ability to step back through previously selected objects to retrieve these as selected. From here though, I do not see, yet, an example of where this would be useful. Holger’s clip is partly there but it seems to have some other smarts included, if I am reading this right.

Anyway, for named selection sets, you can have a poke at the Selection Sets plug-in, from ages ago, here:

and see if that helps at all.


Hi Jordy,

Thanks for the plug-in!