Grasshopper

algorithmic modeling for Rhino

Hi,

I may be missing something obvious or setting up my expression incorrectly, but I am looking to write an IF statement in an expression with x as TRUE between two values. Ex. IF(1<x<2,y,z) as in if the x value is between 1 and 2, provide y and z values accordingly. But the expression editor gives errors- am I missing something?

Thanks

Views: 1902

Replies to This Discussion

Hi Neil,

would this work for your purposes? - Nesting one IF inside another

IF(1<x,IF(x<2,y,z),z)

Perfectly!

Thanks!

Oh, just thought of a different one:

IF(AND(1<x,x<2),y,z)

'And' should be between two operands ideally:

If(x>1 And x<2, y, z)

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