V2 beta Apr-12-2009 available now

 From:  Michael Gibson
2570.55 In reply to 2570.47 
Hi PaQ,

> Do you plan to add a way to select every objects from a style
> with a [key]+click combo ? I know I can use the browser for
> this of course, but that will be a nice 'visual' shortcut.

I haven't planned on doing that with a built-in key combo - the main method for selecting by style is to use the browser by clicking on the text part of the style name.

But if I understand you correctly, it is possible to set up a script on a shortcut key, that will expand the selection to include all objects of the same style as one that is currently selected.

Here is the script for that:

script: /* Expand selection over same styles */ var objects = moi.geometryDatabase.getObjects();var styles = new Array();for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.selected ) styles[obj.styleIndex] = true; } for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( styles[obj.styleIndex] ) obj.selected = true; }


So to use that, first select an object from the style you want to target, then hit the key to trigger that script and all the other objects of that same style will be added to the selection.

Is that the kind of thing that you were thinking of here?

This script currently will only look at "top-level" objects, it won't go into sub-objects like faces or edges that may have different styles on them. Let me know if you want a version that handles those, it will be a slightly longer script.

- Michael