Grasshopper

algorithmic modeling for Rhino

I'm looking to create a component for GH, and I am wondering if it is possible to replace input parameters with built in sliders.

Views: 702

Replies to This Discussion

Hi Pierre,

yes. There's two ways in which this can be done, but neither is particularly easy.

  1. When a new instance of your object is added to a document, you also add a bunch of preset sliders. This means the sliders can be disconnected by the user at will and replaced with other inputs.
  2. You can override the attributes of an object and draw your own sliders and handle all mouse events yourself.

[1] is the more flexible approach from the users point of view, it's also less work. [2] can be done, an example of this would be the colour picker object, which has a bunch of sliders for the colour channels, or the Galapagos Gene Pool object which combines a bunch of sliders. It's quite difficult to make your own attributes, but there's an example in the Grasshopper SDK documentation ('Custom Attributes' in the Examples section, VB and C# examples provided). It doesn't tell you how to custom handle mouse events, but it's a start.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks,

You have been an immense help! If there is any way that I can help to support further development of GH please let me know.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service