Grasshopper

algorithmic modeling for Rhino

Hello all,

 

I am using GH to map various pieces of data from an imported speadsheet.

 

basically I would like to know how I write an expression so that I can dispatch a point or line if a particular piece of a text statement is true.

 

For example if the contents of {1} = "Peter Cook", dispatch one item/point/instance.

If contents of {1} = Not "peter cook" then do nothing

 

 

Im sorry if it is not clear what I am asking it is a little difficult to explain.

 

Thanks in advance!

 

Chris

Views: 1567

Replies to This Discussion

Hi Chris, you could use the Fx1 component with the function Contains(x, "Peter Cook") to create a dispatch pattern.

Thank you Pieter, thats fantastic. i had an idea that it involved the Function 1 component but was not sure exactly the expression, nor the way dispatch needs the list and the boolean pattern as inputs.

Very helpful thank you very much.

Glad I could help Chris.
(Just hover over an input to find out what you should feed it)
(n.m.: just noticed I spelled both our names wrong, sorry :)

Edit:
You could also write an IF statement: if(x="Peter Cook",1,0)
There are probably more ways...

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