Passing data of own type between C# components

Hi,
I’m trying to create own components in C# which will create and use data of own class/type. And I have difficult times to understand how to achieve it.

I’ve read this topic:
https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974

But I still do not understand it. What is IGH_Param and what is GH_Goo? etc.
Could you give me a simple example of how to output the object of own class?
Something like:

public class own
{
double num;
public own(double n)
{
num = n;
}
}

Passing data via existing types is not the way in my case.

Thanks a lot

You doing this in Visual Studio or the C# components?

At any rate, go into the Grasshopper Help menu and Download the SDK help file. It has VB and C# examples on how to create your own data types and parameters.

I’m doing it in VS2019. I managed to create components with grasshopper C# template.

I downloaded SDK help but it doesn’t show up.

I’ll try it later on a different computer. Is there a specific example about this topic?


1 Like