How to create a drop down list containing many materials and assign to the box. Please help me!

Hello everyone, I am new here. I am learning the basics of Grasshopper for Rhino.
I have created a box and need to assign material to that. but I don’t know how to create a drop-down list of materials containing all kinds of materials? I want to load that box to shapediver and control material by drop list. Does everyone help me? Thank you very much.switch (7.6 KB)

Sure, its very easy.

First you create a list of all the materials using the Merge component. Then you configure a dropdown list. You have to right-click on it and chosse Edit… then you get a text box.

You just enter your choices and then = and then usually a number (usually starts at 0, since list indexes also start at 0).

So you just enter like:

Material 1 = 0
Material 2 = 1

Then you use a List item component to chose a material.

switch material (14.8 KB)

Waoo, It is really cool. thank you very much.