No random color

 From:  Michael Gibson
4517.13 In reply to 4517.10 
Hi Pilou,

> something like this ? modification of the script above :)

Yup, it looks like that works, except the only problem would be if you had more than 100 objects the ones that were above the last style index will end up with the default first style applied to them instead, since that would be trying to assign them a style that does not exist.

So maybe you would want to wrap around to avoid that, something like:

script: /* Assign styles to solids */ var styles = moi.geometryDatabase.getObjectStyles(); var breps = moi.geometryDatabase.getObjects().getBReps(); var style_index = 0; for ( var i = 0; i < breps.length; ++i, ++style_index ) { if ( style_index == styles.length ) { style_index = 0; } var brep = breps.item(i); brep.styleIndex = style_index; }

This one when it reaches the last style it will start over at 0 for the next style after that.

- Michael