Grasshopper

algorithmic modeling for Rhino

I have been trying to create clusters with optional inputs, which when empty have a default value and an override value when not empty. I am thinking this is probably a quick scripting exercise, but even then I'm not sure if it would work at the beginning of a cluster.

I thought it would be something like:

Cluster input -> Null Item -> stream filter

So if the item is null (no input) the filter would get one value, and if it is not null, it would get another.

Any easy way to achieve this? If not, it would be a cool feature david :)

Views: 2182

Replies to This Discussion

haha yeah!

Also, just to be extra clear to everyone what I originally posted about - I was trying to get the inputs of clusters to have a default value when no inputs were provided. My first thought was exactly what Igor posted. this is the result:

On top are the contents of the cluster, in the middle is the cluster working properly when an input is provided, and below is what happens in this case when no input is provided (doesn't work).

Conversely, if you take the cluster in the middle of the image above, input whatever you want the default value to be (in this case I chose 0), then right click on the "Int" input and internalize the data, you get this:

Where when an input is provided, it is passed through. And when no input is provided, the default value of 0 persists.

So basically as of now this is the best way to achieve a default input for empty inputs in clusters. The only downside is it is not permanently a part of the cluster. If someone was to clear the internalized value it would no longer work.

I don't know if this will be the case in GH 0.9+

-Brian

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service