Can I use the original component in gh as a function when I write a gh plug-in in c#?[C#]

Can I use the original component in gh as a function when I write a gh plug-in in c# and how?
for examle:I want to make the surface closest point which is a component that grasshopper alread has had as a funtion in C#.

https://www.grasshopper3d.com/m/discussion?id=2985220%3ATopic%3A1418213

If you really want to use the entire component in code exactly as it is in Grasshopper then yes, it is called NodeInCode: Using the NodeInCode namespace

However, many things can be found in Rhinocommon directly, for instance your example for Surface Closest Point can be from this: https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Surface_ClosestPoint.htm

But maybe if you really needed something complex and didn’t feel like remaking it, such as voronoi3d or something, then you can use NodeInCode.

3 Likes