Macro request, objects display color -> layer assigned color

I often work with files coming from other people.
Some of their layers have set object’s color to be different from Layer color.
Can somebody help me with a macro that makes all objects display color to match the layer assigned color?

Thanks,
Yianni

You don’t a macro. Just select all objects (Ctrl+A) then from the Properties panel, change the object color to “By Layer.”

Oh I see.
Over the long time I m using Rhino, I got a good knowledge of its use, but I now strive to increase my work speed.
Since its not possible to be done with a macro, can it be scripted?
Any volunteers? :smile:
(I wish I had the time to learn a bit scripting…)

Hi Yianni -

! _SelAll _NoEcho _-Properties _Object _Color _Layer _EnterEnd

-Pascal

I am most Grateful Pascal !

This button macro should do the trick:

_-SelAll
_-Properties _Object _Color _Layer _Enter _Enter
_-SelNone

And here is the RhinoScript equivalent:

Sub ResetObjectColor
	Dim arrObjects : arrObjects = Rhino.AllObjects
	If IsArray(arrObjects) Then
		Call Rhino.ObjectColorSource(arrObjects, 0)
	End If
End Sub

Thank you Dale !