Ghpython compiling

Hi, I was trying to use method two for compiling ghpython nodes as described here:
Tutorial: creating a Grasshopper component with the Python GHPY compiler - Serengeti (Rhino WIP) / Developer - McNeel Forum

I want my package to contain a dropdown menu, and attempted to add the following code to replicate the setup I’ve used in c# before:

class DropdownMenu(Grasshopper.Kernel.GH_AssemblyPriority):
    def PriorityLoad(): # override method        
        Grasshopper.GH_DocumentEditor+=OnAggregateShortcutMenuItems
        return Grasshopper.Kernel.GH_LoadingInstruction.Proceed

    def OnAggregateShortcutMenuItems(self, e):
        # Get a reference to the main Grasshopper canvas
        ribbon = e.MainMenu # Get ribbon
        _item = System.Windows.Forms.ToolStripMenuItem()
        _item.Text = "Button Name"
        _item.Click += ItemClick1 # Add a click event handlers
        
        _cowiMenu = System.Windows.Forms.ToolStripMenuItem()
        _cowiMenu.Text = "Menu Name"
        _cowiMenu.DropDownItems.Add(_item)

        # Add the custom menu item to the Grasshopper canvas menu
        ribbon.Items.Add(_cowiMenu);
    
    def ItemClick1(self, args):
        System.Diagnostics.Process.Start("O:\\Applications\\Global")

But it does not seem to run the “PriorityLoad” function when Rhino starts. I tested by adding a message box. Is it possible to add this type of functionality to a .ghpy assembly?

The compilation file and the code itself is attached.
AssemblyNode.py (4.9 KB)
Main.py (83 Bytes)

Br
Audun Mathias Øvstebø

Hi @amoe

this functionality has been replaced in new versions of Rhino, starting with Rhino 8.
@eirannejad may be able to tell you the state of the art. The PriorityLoad method was not available in 7.

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Just to make sure I understand your answer, what you mean is that the PriorityLoad method was not available to be overwritten in Rhino 7 for compiled ghpython components?
And in Rhino 8 developments are done for the new scripting component as displayed here: Creating Rhino/GH Plugins in Script Editor - Scripting - McNeel Forum
And @eirannejad will reply regarding the possibility to develop a dropdown menu in the new setup without creating a project in visual studio?