Rhino RDK combo box .net


#1

Hello,

How can I add a ComboBox in the material editor? I need to give some predefined options for a material parameter. I need something like that:

string[] data = new[] { "option1", "option2", "option3" };
//Rhino.Render.Fields
var field = Fields.Add("fieldComboBox", data, "Choose an option"); 
BindParameterToField("fieldComboBox", field, ChangeContexts.UI); //RenderContent

Thanks,


(Steve Baer) #2

@andy or @JohnM, can you help with this one?


#3

Hi,
Really good question, there is a solution?
@andy, @JohnM, @stevebaer, @Guille
Luca


(Andrew le Bihan) #4

Ah - OK, now I think I understand. There is no way to get an automatically generated combo box. You will have to use a custom form.


#5

Hi Andy,
Thanks for your feedback, but I don’t undestand.
For example, to add a float in the User interface we use:

var intIOR_field = Fields.Add(INTIOR_FIELD, IntIOR.FirstParameter, “Interior Index of Refraction”);
BindParameterToField(INTIOR_FIELD, intIOR_field, ChangeContexts.UI);

It works great with floats, but I want to use a list of strings. We need exactly the same as Brasil:

Do you think we need to create a form to do it? If yes, how we can use this code with a form instead of a float?

var intIOR_field = Fields.Add(INTIOR_FIELD, IntIOR.FirstParameter, “Interior Index of Refraction”);
BindParameterToField(INTIOR_FIELD, intIOR_field, ChangeContexts.UI);

Thanks,

Luca