From:  Michael Gibson
2619.19 In reply to 2619.13 
Hi Patrick,

> Would be great! I would use that rather than hiding inside the
> style itself. H as a shortcut to hide geometry to a construction layer
> that is turned of by default. And accessible when you need it.

Here is that script for you:

script: /* Hide selected objects, and assign to style = Hidden */ var gd = moi.geometryDatabase; var styles = gd.getObjectStyles(); var si = -1; for ( var i = 0; i < styles.length; ++i ) { if ( styles.item(i) /hidden/i ) != -1 ) si = i; } if ( si == -1 ) { var style = gd.addStyle(); = 'Hidden'; si = style.index; } var objects = gd.getSelectedObjects(); objects.setProperty( 'styleIndex', si ); objects.setProperty( 'hidden', true );

To set it up, in MoI go to Options / Shortcut keys, and hit the "Add" button.

That will add in a new entry at the top of the list, type in H for the Key part (or whatever key or key combination you want to trigger it), and then for the Command part copy the above script which is all one long line and paste it in there.

Then after that, if you select objects and type H those objects will get assigned to a style named "Hidden", and also the objects will be set to be hidden so that you won't have to do any other steps for getting them out of your way.

That should make that particular operation go rather more smoothly.

- Michael