How to mapping differiently objects in variety?

hello. thanks to read my question. also i don’t know english well
i want to mapping many objects(surface or poly-surface or extrude) to varies material.
2 objects mapping different color is easy. but sometimes we have 1000~30000 objects
it’s vary hard and it takes a long time.
in grasshopper, i can see different color with preview and color gradiation but after bake
it was only layer color.
can u help me?

Well, probably not much can be done about that. You start computing a lot of data, it will take a lot of time.

If you use the Custom Preview component to view objects with a specific colour, they will bake with the appropriate render materials, but not with a display colour override. So in shaded the objects will take the layer colour, in Rendered (and Raytraced) they will use the render material.

In Grasshopper:

In Rhino (Shaded=top, Rendered=bottom):