Click on a panel button with Python script

Hi,
I’m trying to click a button in a Panel of a plugin (it is a my plugin so I know the button’s name and ID) with a script written in Python. I searched in rhynoscriptsyntax but I didn’t find anything. Can someone help me please?
Thankyou

You need to check out the Grasshopper SDK

Hi @603419608, but I’m working with RhinoCommon and I created a Plugin, I’m not using Grasshopper . Maybe there is a way to get the name/id of the button and then do a click?

If it’s your plug in then why not call the code behind the buttons OnClick eventhandler?

This would be way cleaner than determining the buttons position in screenspace and scripting a mouse click there

Edit:
How did you set up your panel?

@lando.schumpich, thakyou for your answer.
Yes, scripting a mouse click works, but I’m searching a more elegant way to do it.

Anyway I found the solution. I discovered that I’m using IronPython so I can import libraries from C#. So with the Guid of the Panel I got it and then I did a PerformClick of the button (using the name of the button).
Thankyou