I don't understand... Evaluate


(Arnaudgen) #1

Hi,
I’m a beginner on Grasshopper. I want evaluate an expression, but the result dont given that i want.

I have 5 inputs: my expression, 2 inputs for compare, 2 lists.

In v, I have 3 index in input, but 4 in output…

Can you help me ?
Thanks.
Arnaud


(David Rutten) #2

The default behaviour of components is to keep iterating until all inputs have been dealt with. Because your z input contains 4 values, the component will run 4 times. It isn’t smart enough to understand that under some conditions the z values aren’t actually used.

Possible solutions are:

  1. Combine your v and z items into a single piece of text. For example by concatenating them using “|” as a separator. Then afterwards you split the text again using the same character and get back your list.
  2. Instead of running the expression for every value in v or z, run it only once, outputting either 0 or 1. Then use those integers to access a specific data stream.

(Arnaudgen) #3

Thank you for your help. It’s ok.