# Referencing Rhino Geometry in Grasshopper C#

**URL:** <https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169>\
**Category:** Grasshopper Developer\
**Tags:** rhinocommon, grasshopper, programming, api\
**Created:** [December 29, 2019, 7:42pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169 "2019-12-29T19:42:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.khalili9093](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/m.khalili9093/32/162433_2.png) [@m.khalili9093](https://discourse.mcneel.com/u/m.khalili9093)\
**Post date:** [December 29, 2019, 7:42pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/1 "2019-12-29T19:42:14Z")

</div>

Hi everyone

I want to create a component for grasshopper in C#. the component has to be able to select a curve from rhino (as you know there is a Curve parameter in grasshopper that we can select set one curve /set multiple curves and then we are able to select a curve from rhino i showed in the image below) .I want to know If in my component I need to select a curve from rhino what should I write for that in C# ?

Thanks a lot in advance!

 ![4421](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/e/3/e3357643ad6b98946d21c3656f280acf380466f4.jpeg)

---

<div class="post-metadata">

**Author:** ![rawitscher-torres](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rawitscher-torres/32/159606_2.png) [@rawitscher-torres](https://discourse.mcneel.com/u/rawitscher-torres)\
**Post date:** [December 29, 2019, 7:56pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/2 "2019-12-29T19:56:56Z")

</div>

Why would you need or want to do that? Why not just take the curve(s) input in to your component from the grasshopper curve parameter component which is the one you showed on the screen shot. Take advantage of the workflow that is readily available and rather invest your time in doing more interesting stuff.

---

<div class="post-metadata">

**Author:** ![m.khalili9093](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/m.khalili9093/32/162433_2.png) [@m.khalili9093](https://discourse.mcneel.com/u/m.khalili9093)\
**Post date:** [December 29, 2019, 8:05pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/3 "2019-12-29T20:05:15Z")

</div>

thanks for replying.  
Excuse me I think i didn’t understand correctly. I wanna know if i wanted to use "Curve parameter " in my code , how should i write this . whats the name of its class in grasshopper api?

---

<div class="post-metadata">

**Author:** ![Michael\_Pryor](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michael_pryor/32/489117_2.png) [@Michael\_Pryor](https://discourse.mcneel.com/u/Michael_Pryor)\
**Post date:** [December 29, 2019, 8:15pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/4 "2019-12-29T20:15:25Z")

</div>

Are you talking a component from the script editor component or from visual studio?

---

<div class="post-metadata">

**Author:** ![m.khalili9093](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/m.khalili9093/32/162433_2.png) [@m.khalili9093](https://discourse.mcneel.com/u/m.khalili9093)\
**Post date:** [December 29, 2019, 8:25pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/5 "2019-12-29T20:25:40Z")

</div>

Hi Michael  
component from visual studio (C#)

---

<div class="post-metadata">

**Author:** ![rawitscher-torres](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rawitscher-torres/32/159606_2.png) [@rawitscher-torres](https://discourse.mcneel.com/u/rawitscher-torres)\
**Post date:** [December 29, 2019, 8:36pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/6 "2019-12-29T20:36:16Z")

</div>

A Curve Parameter is a Grasshopper component it’s not a RhinoCommon or Grasshopper class. Behind the scenes that parameter component is a wrapper to the RhinoCommon Curve class. So 2 things are happening. There is a `GH_Curve` class that implements `GH_GeometricGoo<Curve>` . Then there is another class let’s say `GH_CurveParam` which implements `GH_PersistentParam<GH_Curve>` , `IGH_PreviewObject` and `IGH_PreviewData` This class is what actually makes it presentable as a Grasshopper Parameter component.

So I still don’t understand what you want to do and why does the Curve Parameter component not work for you.

---

<div class="post-metadata">

**Author:** ![Michael\_Pryor](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michael_pryor/32/489117_2.png) [@Michael\_Pryor](https://discourse.mcneel.com/u/Michael_Pryor)\
**Post date:** [December 29, 2019, 11:00pm UTC](https://discourse.mcneel.com/t/referencing-rhino-geometry-in-grasshopper-c/94169/7 "2019-12-29T23:00:16Z")

</div>

You can make your input like:

_pManager.AddCurveParameter(“InputName”, “InputAbbreviation”, “InputDescription”, GH\_ParamAccess.item);_

or for list like:

_pManager.AddCurveParameter(“InputName”, “InputAbbreviation”, “InputDescription”, GH\_ParamAccess.list);_

This will make your input as a curve input which will have the “set curve” right click option.
