How to create a relationship between two sets of values in Grasshopper

I am trying to create a parametric structure and need to create a relationship between the following sets of values. x values: 8,10,12,14,16 and y values: 5,6,7,8,9.

so for example, when I choose the number 10 with a number slider, I can somehow get the number 6 in a different part of my script.

let me know if I need to be more clear. Any help would be greatly appreciated.

You could just use a simple value list.

Double click the value list to edit it. I edited it with the following:

8 = 5
10 = 6
12 = 7
14 = 8
16 = 9


Now I’m realising you probably want to use both the x and y value, so here is another option. (12.9 KB)


yes this is great thanks a lot Adam.

Just one thing, why is it not possible to replace the panel containing the number 10 at the very beginning of your script with an even number slider?

For Member Index to work, the formats have to match exactly. The panels are text, and the slider is a number, so it wont be able to find an exact match.

You can convert the values to integers. Or use the Find Similar component instead, which can be a bit more flexible.

Thanks for the response, but I found a simpler solution. I just connected my number slider to a panel component, then fed the panel component into the member index.