Simple layer script
Sorry to keep posting simple little questions. I am trying to learn maxscript but I keep getting stuck on dumb little things.
I want a script that will loop through a selection and move the objects to a new layer with the layer name matching the object name. But also change the wire color to colors inside of a defined array.
So object 201.MDL:brck will be moved to a newly created layer named "201.MDL:brck"
with the wire color matching the first color in the "sColor" array. And so on and son.
The way I have it written now, the script will create and move the objects to the new layers. But the colors are all the same. It won't cycle through the array and move on to the next color.
sColor = #(red, green, blue, yellow, brown, orange)
for o in selection do
oName = o.name
oLayer = LayerManager.newLayerFromName oName
for c in sColor do
oLayer.wirecolor = c