named view new script

 From:  pressure (PEER)
11036.1 
Here's a new script for making and restoring named views. It's based on Teddy Lindsey's excellent ViewManager, but with a few differences:
  • views are embedded in the .3DM
  • It can be run in the middle of running another command and when done with NamedView you'll end up back wherever you left off in that other command
  • Camera-to-target distance can be set directly. To choose the target select it and then click Reset on the 3D viewport. Then the target point will be the center of what was selected.
  • Field of view angle is easy to adjust
  • Both perspective and parallel projection views are supported
  • Option to automatically restore a view if exactly 1 view has been saved




It only works with v5 beta (version Mar-28-2023) or newer. Installation is a little different because this is an “instant script” rather than a “command”. That means it should go in a “scripts” folder. A “scripts” folder doesn't exist by default, so you might need to make it inside of the Moi appdata folder.

On Windows you can find the Moi appdata folder by typing Win+R to bring up the Windows "Run" dialog and then type in:
%AppData%\Moi\

On Mac from a Finder window, go to the menu and pick Go > "Go to folder" and type in:
~/Library/Application Support/Moi/

You should see “moi.ini” and a folder “commands”. Create a new folder scripts if it doesn't already exist directly inside the folder “Moi”. Then move NamedView.htm and NamedView.js into the “scripts” folder. Finally, set up a shortcut key by going to Options > Shortcut Keys and type in NamedView as the command name.

EDIT 2023-12-20 new version uploaded with bug fixes

- Peer

EDITED: 20 Dec 2023 by PEER