MoI discussion forum
MoI discussion forum

Full Version: RE_HIDE_HIDDEN

Show messages: All  1  2-5

From: Michael Gibson
4 Dec 2025   [#2] In reply to [#1]
Hi neil,

re:
> is there a script that can act as the eye button on the hidden layer ?

I'm not sure what you mean by "the hidden layer" - do you mean a style that is named "Hidden"?

- Michael
From: neilwilson3412
4 Dec 2025   [#3] In reply to [#2]
yes the style called hidden
From: Michael Gibson
5 Dec 2025   [#4] In reply to [#3]
Hi neil, paste this in as the "command" part of a shortcut key. Then when you press that key all objects assigned to a style named "Hidden" will be hidden.

code:
script: var objects = moi.geometryDatabase.getObjects();
var style = moi.geometryDatabase.findStyle( 'Hidden' );
if ( style )
{
	for ( var i = 0; i < objects.length; ++i )
	{
		var obj = objects.item(i);
		if ( obj.styleIndex == style.index )
		{
			obj.hidden = true;
		}

		var subobjs = obj.getSubObjects();
		for ( var j = 0; j < subobjs.length; ++j )
		{
			var subobj = subobjs.item(j);
			if ( subobj.styleIndex == style.index )
			{
				subobj.hidden = true;
			}
		}
	}
}


- Michael
From: neilwilson3412
5 Dec 2025   [#5] In reply to [#4]
thank you i wanted that one. legend

Show messages: All  1  2-5