MoI discussion forum
MoI discussion forum

Full Version: Reset view command or script

From: Matadem
29 Jan   [#1]
Good day.

I am pretty sure I had this once....looking for it I cannot find it.

Is there a command to reset your view (like hitting the reset button?)
and can it be done that it does not zoom at a 100%?

Thank you!
From: Michael Gibson
29 Jan   [#2] In reply to [#1]
Hi Matadem,

re:
> Is there a command to reset your view (like hitting the reset button?)

Reset the active view (same as pushing "Reset" button on viewport bottom toolbar):

script: moi.ui.getActiveViewport().reset();

Reset all views (same as right-clicking "Reset" button on viewport bottom toolbar or using View > "Reset all" button on side pane):

script: moi.view.resetAll();


> and can it be done that it does not zoom at a 100%?

You could add a call to viewport.zoom( 1.1 ) if you wanted it to zoom out a little after the reset.

Like this:
script: v = moi.ui.getActiveViewport(); v.reset(); v.zoom( 1.1 );


- Michael
From: Matadem
29 Jan   [#3]
Thank you!
From: Mik (MIKULAS)
30 Jan   [#4] In reply to [#3]
Very useful.
Thank you.
Mik
From: Matadem
7 Feb   [#5]
Good day.

Question...I have changed to shortcut to use the script which works perfectly.

but everytime I close and open Moi the shortcut is changed back to an old command?

I use c - chamfer and changed chamfer to the new reset script.

Tnx.
From: Michael Gibson
7 Feb   [#6] In reply to [#5]
Hi Matadem, shortcuts are saved in the moi.ini file when MoI closes.

Do you possibly have multiple instances of MoI running when you set up the shortcut?

If so then close all but one instance, edit the keyboard shortcut and then close the last instance so that it can write out settings to the moi.ini file.

If that isn't it then have you possibly set the moi.ini file to be read only?

- Michael
From: shayno
18 Apr   [#7] In reply to [#5]
You may have to resave your open template file so it saves it