store and restore grid

Hi Guys, how´s going?
does anyone can help me? i need two lines of code, one to store the active grid and another to restore the grid. Here´s the deal, i use a script that needs the home grid to work, but i use a lot grids that i create, so my goal is to temporarily set the grid to home, while the script runs, and then go back to previous grid. I don´t know maxscript, i use maxscript recorder to make my scripts :/
Thanks in advance,

Jsrocha

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jsrocha's picture

Anubis, thank you very much!!

Anubis, thank you very much!! this is exactly what i need, it worked just fine!
thanks again,

Jsrocha

Anubis's picture

activeGrid

Hi jsrocha, there is only 1 global variable to dealing with active grid - activeGrid. Hope next is fine:

(
	oldGrid = activeGrid -- store curr. active grid
	activeGrid = undefined -- activate the home grid
 
	-- the rest of the script here...
 
	activeGrid = oldGrid -- activate prev. active grid
)

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.