Ability to randomise the colour of newly created layers instead of the default black
Video explanation
Ability to randomise the colour of newly created layers instead of the default black
Video explanation
Here is an example straight out of the Rhino Python help file. It doesn’t randomize upon creation but does randomize the layer colours that exist.
import rhinoscriptsyntax as rs
import random
from System.Drawing import Color
def randomcolor():
red = int(255*random.random())
green = int(255*random.random())
blue = int(255*random.random())
return Color.FromArgb(red,green,blue)
layerNames = rs.LayerNames()
if layerNames:
for name in layerNames: rs.LayerColor(name, randomcolor())
Maybe this will help. I think your idea about randomizing colours on layer creation would be a nice option.
Thanks,
Dan
Hi Dan
When running this script, it randomises the colours of all layers. Is it possible to randomise the colours of only the layers selected?
-Jeremy
Here’s one that allows you to randomize the color of selected layers.
RandomColorSelLayers.py (541 Bytes)
can you guide me how to use this file in Rhino?