# What does Addparameter first parameter?

**URL:** <https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974>\
**Category:** Scripting\
**Created:** [October 10, 2013, 2:36pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974 "2013-10-10T14:36:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaveh\_Allahdin](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Kaveh\_Allahdin](https://discourse.mcneel.com/u/Kaveh_Allahdin)\
**Post date:** [October 10, 2013, 2:36pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/1 "2013-10-10T14:36:22Z")

</div>

In the method addparameter (to add a custom variable type to component as input or out put) what is first parameter and what does it do?  
it is IGH\_param.  
let’s say my custom type is a class named Library2.

```auto
protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
  pManager.AddParameter( param , "library", "FaL", "Load library",GH_ParamAccess.item);
}

```

---

<div class="post-metadata">

**Author:** ![Kaveh\_Allahdin](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Kaveh\_Allahdin](https://discourse.mcneel.com/u/Kaveh_Allahdin)\
**Post date:** [October 10, 2013, 2:45pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/2 "2013-10-10T14:45:19Z")

</div>

Is this tag ok or should I use Grasshopper developer or else?

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [October 10, 2013, 3:14pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/3 "2013-10-10T15:14:00Z")

</div>

The tag is fine. @piac or @DavidRutten, can you help?

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [October 10, 2013, 5:18pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/4 "2013-10-10T17:18:12Z")

</div>

This call allows to register a parameter that is not one of the “custom” types, like string or brep.

If your custom type is called Library2 (and it must in a way or another implement IGH\_Param - by for example deriving from GH\_Param or GH\_PersistentParam - so better call it Library2Param), you can instantiate it and pass it as an input into pManager.

Does that help?

Thanks

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![Kaveh\_Allahdin](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Kaveh\_Allahdin](https://discourse.mcneel.com/u/Kaveh_Allahdin)\
**Post date:** [October 29, 2013, 9:29am UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/5 "2013-10-29T09:29:07Z")

</div>

Hi again,  
I am still on this thing(ofcourse not all the time) but well,  
As I found out I needed to define my let’s say BaseStuff, Then define  
StuffGHData:GH\_Goo\<“BaseStuff”\>  
and override some methods, then define  
StuffGHParam: Gh\_Param\<“StuffGHData”\>  
override some other methods  
Then use a new one of its instants in addparameter.  
I did it all and no problem till here.Though in the solveInstance which I need to return a result I am wondering should it be BaseStuff type or StuffGHParam.  
I can assign things to BaseStuff not to others but after building it in Grasshopper it turns red.  
any idea?!  
Thanks

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [November 6, 2013, 6:24pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/6 "2013-11-06T18:24:17Z")

</div>

Hi Kaveh

sorry I missed this topic as I did not receive any notifications about this.  
You should investigate the exception that you are receiving. For example, try running the script in the debugger, or look at least at the baloon error message that turns the component red.

Thanks

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![Kaveh\_Allahdin](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Kaveh\_Allahdin](https://discourse.mcneel.com/u/Kaveh_Allahdin)\
**Post date:** [November 6, 2013, 7:07pm UTC](https://discourse.mcneel.com/t/what-does-addparameter-first-parameter/2974/7 "2013-11-06T19:07:30Z")

</div>

Dear Guilio  
I solved that problem.Now I can not load my component on GH.I explained in this post.

> **[Custom component does not load on Grasshopper tab.](https://www.grasshopper3d.com/forum/topics/custom-component-does-not-load-on-grasshopper-tab?xg_source=activity)**
>
> Hi all,
> I did write a complete(ata least I think so) code for a component which reads data from csv file and assign it to a custom type variable. In VS there i…

  
I 've posted files needed there also.I debugged it,but actually nothing happens.it is so silent with no error I can not find my mistake .may be you can have a look and help  
Thanks,  
Kaveh
