Grasshopper

algorithmic modeling for Rhino

Hello World - I'd like to be able to access the Grasshopper Panel (sliders) and the 'bake' function via vbscript. It would be cool if there were some methods that could be written, or at least the provision for access to these options through Rhino's command line. Any thoughts?

Views: 3491

Replies to This Discussion

Hi Matt,

this is certainly possible, plugins can expose functions via RhinoScript. How would the functions you want look?

All objects in Grasshopper have an ID (just like Rhino), so you can securely access a slider. But how would you know the ID? Do you need something akin to Grasshopper.GetObject ?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks for your response, David. Let me think about it and I'll get back to you. How familiar are you with Generative Components? I'd like to do in GH what I could do in GC, using C# (with the previously mentioned goal in mind). There may be a way to do it the other way around, using VB inside GH, I'm just not sure...
David,

What if you made a function similar to Rhino.GetPlugInObject that would read something like Rhino.GetGHslider ("Name_of_Slider",LL,UL,POS). Input: [1] the name of the slider, [2] the lower limit,
[3] the upper limit, [4] the slider position.

What do you think?

Matt


Radlab, Incorporated
25 Drydock Ave, Floor 6
Boston, MA 02210
W| radlabinc dot com
E| matt@radlabinc
P| 617.440.3588
Hi Matt,

it could work something like this:

Dim GH : Set GH = Rhino.GetPluginObject("Grasshopper")

Dim idSlider
idSlider = GH.FindObjectByName("my_special_slider_name")
If (IsNull(idSlider)) Then Exit Sub

GH.SetSliderValue(idSlider, 0.0, 1.0, 0.25)


I cannot add functions to "Rhino." since RhinoScript is a different plugin that can be installed whether or not Grasshopper is installed. Thus, all I can do is offer another object, which exposes methods that allow you to interact with Grasshopper via the Rhino.GetPluginObject() method.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
David,

That looks like it would work well. Shall we try it?

Matt
I've got a bit of a deadline for SmartGeometry next week, but my schedule should (finally) free up a bit after that.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Ok, cool. Thanks for your help with this, David.

Matt


Radlab, Incorporated
25 Drydock Ave, Floor 6
Boston, MA 02210
W| radlabinc dot com
E| matt@radlabinc
P| 617.440.3588
That's rad. I'm looking forward to this!
For sure! I think it will help enormously with exploring/studying/animating parameter combinations.

Hey Luis, you're with LAN, right? I've been teaching a Design Computing and Digital Fabrication course at WIT (http://designcomputing-wit-fa09.blogspot.com/), and through that I've gotten to know Aaron Willette a bit and learned more about what you guys do. He's a good guy. If you're in Boston any time soon it would be great to meet you and have you over to our office.

Matt


Radlab, Incorporated
25 Drydock Ave, Floor 6
Boston, MA 02210
W| radlabinc dot com
E| matt@radlabinc
P| 617.440.3588
can GH objects (such as sliders) be created via VB? and connected to existing flows?
Jonathon,

this is technically possible, though there are no easy-access-methods for this type of stuff in the SDK. Also, modifying the definition WHILE the definition is solving itself is a very bad idea, which is why all this stuff is so hard from within VB and C# script nodes.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Yes this is fair enough.

We are currently making a definition with dozens of potentially redundant sliders the inputs of which get trimmed off relative to a number of other inputs. just being anally retentive about them being there.

What would be cool is if there was a slider component where you define how many sliders there are. a bit like increasing/decreasing the inputs to a stream gate or a vb item.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service