In Rhino 7 we had some components which had dynamic input arguments named depending on the selected item from the context menu of the component. The items in the context menu were also added dynamically by the component.
I am trying to get these working in Rhino8 as IronPython2 components but have the following issue:
I am not able to add custom items to the context menu. I’m overriding AppendAdditionalComponentMenuItems
but it doesn’t seem to do anything.
from ghpythonlib.componentbase import executingcomponent as component
class DynamicComponentTest(component):
def RunScript(self):
pass
def AppendAdditionalComponentMenuItems(self, *args, **kwargs):
item = menu.Items.Add("menu item #1", None, self.on_item_click)
def on_item_click(self, *args, **kwargs):
pass
Nothing gets added to the context menu.
Am I doing anything wrong?
Thanks,
Chen