MoI discussion forum
MoI discussion forum

Full Version: Scripting Object Visibility?

Show messages:  1-17  18-21

From: shayno
12 Aug   [#18]
Hi Michael
Similar to hide unhide by style
Is it possible to write script to hide / unhide by object name say 'old'
As I cad new rings next to old designs I constantly have to hide/unhide the old one to clear the screen
Moi Ver 4
kind regards
shayne
From: Michael Gibson
12 Aug   [#19] In reply to [#18]
Hi shayne,

re:
> Similar to hide unhide by style
> Is it possible to write script to hide / unhide by object name say 'old'

Try this one:

script: /* Toggle visibility of given name */ var name = 'old'; var item = moi.ui.sceneBrowser.objects.find( name ); if ( item ) { var any_hidden = false; var objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length && !any_hidden; ++i ) { var obj = objs.item( i ); if ( obj.name == name && obj.hidden ) { any_hidden = true; } var subobjs = obj.getSubObjects(); for ( var j = 0; j < subobjs.length && !any_hidden; ++j ) { var subobj = subobjs.item(j); if ( subobj.name == name && subobj.hidden ) { any_hidden = true; } } } } if ( any_hidden ) { item.alterStatus( 'show' ); } else { item.alterStatus( 'hide' ); }

- Michael
From: shayno
12 Aug   [#20]
Thanks Michael
I demonstrated and recommended your software to a business associate yesterday , I'm certain he will purchase it.
kind regards
shayne
From: Michael Gibson
12 Aug   [#21] In reply to [#20]
re:
> I demonstrated and recommended your software to a business associate
> yesterday , I'm certain he will purchase it.

Thank you shayne! - Michael

Show messages:  1-17  18-21