Expression in grasshopper

hi everybody, i have a problem for making an expression in gh
i wrote it as below but it does not work:

if((x=1,20,34,45,60),ok,error)

That part isn’t valid. Do you expect that to be true if (x=1) or (x=20) or (x=34) or (x=45) or (x=60)?

And ‘ok’ and ‘error’ must be defined/renamed inputs to the Eval component.

1 Like

thanks i did what you said and it worked

Good. I thought it would be simple to put a few GH components together to do the equivalent (see white group below), but it was more obscure than I thought, esp. because the Int params are required. Even Series and integer slider components!?


num_in_set_2018Mar31a.gh (16.2 KB)

Probably a simpler way?

This seems like a simpler way to me :slight_smile:

a = x in (1,20,34,45,60)