Grasshopper

algorithmic modeling for Rhino

Is there a "if then" component to do calculation based on evaluation for each item within a list?

Assume I have a list A of 1 and 0 values, how do I change it to a new list B in which the value of a item is x if the same item in list A is 1, otherwise, the value of an item in list B is y if the same item in list A is zero?

Is there a "if then" component to do this?

Thank you!

or something like this:

Views: 311

Replies to This Discussion

Try "Evalute" or "Expression" component with "If" function. Best.

Attachments:

Dear Hyungsoo, thank you very much for the advice!

Great to learn the function of the expression component.

Pro-tip, if x is already a boolean, you can just type If(x, 24, 99)

Thank you very much, Dear David, for the Pro-tip!

Too much to learn from the community the diverse functions of GH.

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