Reading a valuelist

I feel like I’m missing something here, but I can not find out how to read data from a valuelist component using GH_InputParamManager and IGH_DataAccess.GetData in Visual Studio.

Maybe someone has a little example to clarify this?

Thanks

You can only read the value you’re given by the Value List, not its other values. Is that what you’re after?

1 Like

Hi David, thank you for your reply. Looking back at the question, it was a typical friday afternoon thing.

I found out the initial question to ask should have been: “How can I add string items to a value list’s expression field?” and the answer is simple: wrap it in quotes:

vallist.ListItems.Add(new GH_ValueListItem(value, "\"" + value + "\"")

Or:

vallist.ListItems.Add(new GH_ValueListItem(value, value.ToString())