Isolation mode ? Sub-layers(styles) ?

 From:  Michael Gibson
3415.6 In reply to 3415.5 
Hi DesuDeus,

quote:
Thanks it work great, but could it be a "toggle" ?

You press the shortcut, everything is hided but not the piece
Then you work on the piece and when you are done you press that shortcut again
And everything gets back to its original state


It's not so easy to make a script that makes it a completely accurate toggle, because that means storing information from one run of the script to the other.

But here is a version that comes pretty close - if it did not find anything to change to wireframe, it will instead show faces to bring objects out of wireframe mode, but it will avoid changing objects that have been totally hidden:

script: /* Toggle unselected objects to wireframe */ var breps = moi.geometryDatabase.getObjects().getBreps(); var didone = false; for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); if ( brep.hidden ) continue; if ( !brep.selected ) { var faces = brep.getFaces(); for ( var j = 0; j < faces.length; ++j ) { if ( !faces.item(j).hidden ) { faces.setProperty( 'hidden', true ); didone = true; break; } } } } if ( !didone ) { for ( var i = 0; i < breps.length; ++i ) { var brep = breps.item(i); if ( brep.hidden ) continue; brep.getFaces().setProperty( 'hidden', false ); } } moi.view.resetAll(); moi.ui.redrawViewports();

- Michael