Grasshopper

algorithmic modeling for Rhino

Boolean property to detect if an optional input/output is connected or not.

I currently have an optional input, let's say its index is = 1.

Is there a boolean property to detect whether it's connected to a wire or anything?

For example, each input/output has a property that shows you its NickName:

Is there one that's like

evenBetterValueList.Params.Input[1].Connected

Which would output a bool?

Thanks.

Views: 445

Replies to This Discussion

HasInputGrip is readonly and tells Grasshopper whether or not a parameter has an input grip. For example a Slider object only has an output grip.

You're looking for SourceCount or, alternatively, Sources.Count

--

David Rutten

david@mcneel.com

Right, so if SourceCount == 0 the parameter is not connected, if SourceCount > 0 then the parameter is connected.

--

David Rutten

david@mcneel.com

You can add any number of sources to a parameter. Just hold down Shift while making the new wire.

--

David Rutten

david@mcneel.com

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