Is it possible to use rhino developer docs samples in C# grasshopper?

Hi Erveryone,

I must admit I only know very little about coding, but I want to know if it’s possible to use any of the samples on rhino docs in the C# component:

As an example I would love to use this script in gh:

Thank you,

private void RunScript(Mesh mesh, List<Point3d> points, Vector3d vector, ref object A)
  int[] indices;
  var prj_points = Intersection.ProjectPointsToMeshesEx(new[] {mesh}, points, vector, 0, out indices);
  A = prj_points;
} (9.7 KB)

Hi Mahdiyar,

Thank you so much. This is great!
…eventhough I still don’t get how you did it :slight_smile:
But I guess I should look into C# coding or ?


Dear @toh
the developer samples you quote are for plug-in development. As Plug-ins target to be rhino-commands and not grasshopper components the sections of the script that handle the input and output are different.
the section that handles the geometry is the same for a rhino-c#-plug-in-command and a Grasshopper component.
for the example you mentioned:

 var prj_points = Intersection.ProjectPointsToMeshesEx(new[] {mesh}, points, new Vector3d(0, 1, 0), 0, out indices);

of course can be used inside a grasshopper c# script or grasshopper component.
you may also want to check out

kind regards -tom

Hi @Tom_

Great thank you so much. This makes sense I think :slight_smile:

But is it possible to find a “library/overview” of all the variables that I can use in a C# script / component?

I’m gonna check out your link,

Kind regards

thats your starting-point:

1 Like

Uhhh biig library :slight_smile: - amazing!