Running Script Faster in V8

Hi guys,

Is there any way to make this script run faster in Rhino 8? It runs a little slow when you have 30-40 layers like I do.

This script randomizes all layer colors, excluding black.

Thanks in advance!
Jeff

!-_Runscript
 (
Option Explicit
'Script version Saturday, June 14, 2008 2:07:46 PM

Call Main()
Sub Main()

Dim arrAllLayers : arrAllLayers=Rhino.LayerNames()
Dim strLayer

for each strLayer in arrAllLayers
       Call Rhino.LayerColor(strLayer,Rnd*(256^3))
next

End Sub
)

Hello - try Rhino.EnableRedraw(False) before and (True) after, the for each loop.

-Pascal

That did it! Almost instantaneous now!

Thanks so much, Pascal!