Grasshopper

algorithmic modeling for Rhino

Hey guys,

I have a loop from lets say: i as int32 = 0 to 50. 

I am trying to make an IF THEN statement, where: IF i = even integer THEN it does something ELSE it does something else. 

However I cannot figure out the right syntax to write this statement.  

Does anyone know how to do this? 

Any help would be appreciated.

Thanks.

Views: 2104

Replies to This Discussion

If(x Mod 2 = 0, PerformActionOnEven, PerformActionOnOdd)

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Great!

Thanks David!

I am trying to do an if/then statement from the Collision Many|Many component.   If "True" then, move "x" amount....   I have written in a function component the statement "If (x="true", "not true", "true")....

Is there documentation on what can and cannot be written here?  What language is this using?

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