Grasshopper

algorithmic modeling for Rhino

Conditional Statement - Apologies for Previous confusion!!!

Hello All,

i want to use conditional statement.

if x (an integer) is greater than y(an integer) than use Y.

i have got list of 30 numbers (using series component), but i do not want to use number which are greater than say 2. Is any number is greater than 2 than use the number 2.

Kind regards,

AB

Views: 349

Replies to This Discussion

You can use the "min" component for this. Just feed in the value you want to test, and the value you want to set as your upper bound.

If you want a handle on how to use a conditional statement as part of a function, here it is. One thing worth noting is that the function component doesn't read number values from panels as number, but rather as strings, so you first need to translate any such input through a component that does...

Thank you very much David. I, for some reason had presumed that if i use 'min' component it will reduce the string to number lesser than the input. 

thank you for clarifying.

cheers

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service