Grasshopper

algorithmic modeling for Rhino

Hi

i'm currently working on a c++ plugin for rhino which uses grasshopper to bake some objects. for this i'm using the scripting interface of grasshopper according to the sample code of dale:

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleComma...

Now i want to assign objects and paramters to the grasshopper and i have no idea how i should do this within c++.

The AssignDataToParameter is defined as

AssignDataToParameter(parameterID As String, data As Object)

how can i assign for example a rhino surface or how can i assign a simple integer input parameter?

Views: 669

Replies are closed for this discussion.

Replies to This Discussion

Surfaces need to exust in the rhino document first. Then you assign a string that represents the ID of the rhino object. Integers can be assigned directly as integers.

Sorry david, but it seems to be more difficult in c++ than in c#.

i can invoke the method AssignDataToParameter but it simple does not take the right values and does not return "true" as result. Can you explain me a little bit more how AssignDataToParameter expects the values? do they have to be in an array?

Currently i can interpret the data coming from BakeDataInObject . Do i have to put the data in the same form?

The Method has a signature like this:

public bool AssignDataToParameter(string parameterID, object data); 

So basically it will try and parse whatever is supplied. If you can upload an RHP that calls this method I can step into it in my debugger to see what data -if any- comes in.

--

David Rutten

david@mcneel.com

The problem was the order of the parameters. In C++ i have to call the method with the parameters in reverse order. As this method is the only one with two parameters it was until now no problem.

thank you for the help.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service