ScriptSpot

Forum topic · Scripts Wanted

store and restore grid

By jsrocha · 2011-07-24

Description

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 (2)

jsrocha · 2011-07-24

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

Jsrocha

activeGrid

Anubis · 2011-07-24

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
)