Can we convert a Python script to a Popup button?

Hi all,

Just wondering if it is possible to convert an entire python script(a simple and short one) into a button and put it onto the Popup toolbar?
Just like creating my own command button.

Thank you in advance :smile:


The simple way is to create a new button, then open the button editor and in the text box, type the following:

! -_RunPythonScript (

paste your entire script in here


Then OK to accept the button (edit the image as well if you wish).

If you created the new button directly in your popup toolbar, it will be there already, otherwise, if you have created it in another toolbar, you can copy the new button over to the popup toolbar.


Hi Jack,

You can create your own toolbar buttons:

On that button you can set a macro for the command RunPythonScript like so:

your python script here

for example:


import rhinoscriptsyntax as rs

def MakeAPoint():



In the button editor it looks like this:


1 Like

That is exactly what I am looking for~
Big thanks to all you guys!!