Return to previous named view

Wondering whether it is possible to write a macro or script that would return the camera to the previous named view setting?

I have a very complicated architectural model, and I am making some complicated moves in it. I position my camera by invoking a specific named view, and then move my camera. If the move doesn’t go well, and I want to go back to whatever that starting point is. Instead of clicking on the icon in the named view panel, is it possible to write a macro that one would put on an alias? Or a script?

Thank you.

I name my NamedViews “v0”, “v1”, “v2”, etc and to get back to one of these I just need to type v1 & Enter. No need to get into the named view panel…

… Thanks Wim, but that wouldn’t work for me because we use more descriptive names in our office. That’s why I’m looking for a way to get back in to the previous named view ---- whatever it’s name may be. Thank you.


just wondering why not use _UndoView if it has been a single view change ?

I’ve tried something but it is not easy to track the view change a user did from the NamedViews docking dialog. If you could track this, eg. by restoring a named view from a custom dialog, you can save the last restored named view and get back to it. In short, if you restore your named view by using the option “RestoreByName” in below script, you could later use the option “RestorePrevious” on the next run.

Note that the script does require to have some named views and it does not keep track in which viewport the previous named view was restored. It is always the active viewport. (1.7 KB)



I did not know about Undo View. That’s perfect! Thank you.