Color Gradient script?

 From:  GonzoRus
9676.87 
script: /*!Assign RED style to ALL curves */ var styles = moi.geometryDatabase.getObjectStyles(); var curves = moi.geometryDatabase.getObjects().getCurves(); var style_index = 1; for ( var i = 0; i < curves.length; ++i ) { var curve = curves.item(i); curve.styleIndex = style_index; }

This script does not work quite correctly. It makes ALL curves the same specified color (color 0, 1, 2, 3, etc.) existing in the Style Menu. BUT. "Undo" and "Redo" stop working for styles.



script: /*!Assign styles to curves */ var styles = moi.geometryDatabase.getObjectStyles(); var curves = moi.geometryDatabase.getObjects().getCurves(); var style_index = 0; for ( var i = 0; i < curves.length; ++i, ++style_index ) { if ( style_index == styles.length ) { style_index = 0; } var curve = curves.item(i); curve.styleIndex = style_index; }

This script does not work correctly, it assigns different colors to the curves)