Grasshopper

algorithmic modeling for Rhino

Guide to creating custom grasshopper 0.6.X components

People might find this useful.  Please do let me know if you find any errors or omissions.

Best regards,

Ben Sitler

Note: on 2/4 at 13:00 I updated the manual to reflect the discussion on where to locate components on the Grasshopper ribbon.

Views: 19304

Attachments:

Replies to This Discussion

Tx David :)

I have compiled this. Hope it clarifies.

Attachments:

Ben,

Your guide was extremely useful. However, I would like to expand on it and output more than one value from Da:

                For i As Integer = 0 To 100

                    Da.SetData(i, i)

                Next

am I using the wrong syntax. This is giving me an error.

D.

Hi Daniel,

 

do you have a hundred output parameters in your component?

 

If you want to output lists, you'll need to use DA.SetDataList() instead:

 

Dim data As New List(Of Int32)

For i As Int32 = 0 To 100

  data.Add(i)

Next

DA.SetDataList(0, data)

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hello,

 

This might be a very silly question considering the advanced usership in this discussion but I cant seem to be able to download the pdf document.  It either takes me to a blank page or does nothing at all if I click on it.  

It sounds fabulous though.  Any help would be appreciated.

best,

m

Hi, thanks in advance for any help. I've decided to take my coding abilities a step further, I can code within the grasshopper environement, preferably in VB, and now I've decided to make the switch to C# and to Visual Studio (C# Express to be precise) after doing some basic exercises from the internet (a picture viewer, a basic laberynth game). I've come to the conclusion that the way to go is to start doing GH components and learn that way how to call libraries and interact with other programs in order to in a future be able to write plugins and so forth.

To do this I've started with the wonderful guide to custom components and Im stuck in the the hello world example, I have the following error.

this is the example code

pManager.Register_BooleanParam("Execute", "E", "Execute?", false, false);

and this the error

Error    1    The best overloaded method match for 'Grasshopper.Kernel.GH_Component.GH_InputParamManager.Register_BooleanParam(string, string, string, bool, Grasshopper.Kernel.GH_ParamAccess)' has some invalid arguments    C:\Users\nico\Documents\Visual Studio 2010\Projects\ClassLibrary1\ClassLibrary1\Class1.cs    14    5    ClassLibrary1

When I type pManager. the intelisense for register boolean parameter is nowhere to be found, am I missing a library?

I've added all the dll correctly, so I really dont know whats wrong. Any ideas, and also any steps you think I should take to reach the goals expressed in the first paragraph?

Hi Nicolas,

the Register_XXXXParam method have been marked as obsolete. They have been replaced by AddXXXXParameter() methods.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Yeah after several hours I figured the add one must be the one to use, I have like 5 more errors but I assume they are all from obsolete stuff

Obsolete functions should only generate warnings, not errors. A problem with function calls (i.e. when the data you provide cannot be matched to any function signature) will be errors that prevent you from compiling.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi All,

I was just wondering if it is possible to create a custom component in Python?

Thanks

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service