# Programatically "launch" component's menu item

**URL:** <https://discourse.mcneel.com/t/programatically-launch-components-menu-item/69224>\
**Category:** Grasshopper\
**Created:** [August 21, 2018, 9:50am UTC](https://discourse.mcneel.com/t/programatically-launch-components-menu-item/69224 "2018-08-21T09:50:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![aitorleceta](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/aitorleceta/32/480121_2.png) [@aitorleceta](https://discourse.mcneel.com/u/aitorleceta)\
**Post date:** [August 22, 2018, 5:49pm UTC](https://discourse.mcneel.com/t/programatically-launch-components-menu-item/69224/6 "2018-08-22T17:49:38Z")

</div>

While I wait for some help, as long as I can’t figure out how to complete the paths suggested by @DavidRutten , I’am walking blindly, navigating inside ArchiCADConnection.dll, exploring the terrain for alternatives… This is already just a didactical exercise for me.

```python
import scriptcontext as sc
import Grasshopper as gh
from System.Windows import Forms
import clr
clr.AddReference('ArchiCADConnection.dll')
import ArchiCAD

if activate:
    doc = gh.Instances.ActiveCanvas.Document
    comp = [obj for obj in doc.Objects if obj.NickName == name][0]
    comp.Menu_CustomSingleValueItem() #this statement raises the error

```

i’am trying to execute our infamous component’s Menu\_CustomSingleValueItem() method,  
Well, the code above raises this exception:

> Runtime error (TypeErrorException): cannot access protected member Menu\_CustomMultiValueItem without a python subclass of AC\_Polyline
> 
> Traceback:  
> line 23, in script

The method happens to be decorated as protected, so no access posible wihout subclassing. But as i said yesterday, subclassing seems to be not allowed, at least i interpret this from python exception message:

```python
class myPolyParamClass(ArchiCAD.PersistentParams.AC_Polyline):
    def __init__ (self):
        pass

```

boom, in the face…

> Runtime error (TypeErrorException): cannot derive from ArchiCAD.PersistentParams.AC\_Polyline because it is sealed  
> Traceback:  
> line 25, in script

wich is exactly what avoid me to follow David’s suggestion of overriding AppendMenuItems() (if i has understood him correctly)

well… Further orientation would be wellcome.  
thanks

---

_[View the full topic](https://discourse.mcneel.com/t/programatically-launch-components-menu-item/69224)._
