i have a PlugIn which comes with a toolbar (rui) file. Each button in that toolbar runs an IronPython script. The macro in each button looks like this:
! _-RunPythonScript ScriptName.py
The module search path to all scripts is the PlugIn folder. It’s been defined in the new Script Editor under:
After setting the search path, i’ve clicked Apply Changes and restarted Rhino 9 Beta, however the scripts in the buttons do not run. No error is shown.
btw. If i run _-EditPythonScript nothing happens. Has the old Script Editor been removed in Rhino 9 ?
Hi @Gijs, after multiple restarts the old EditPythonScript editor came up and i was able to define my searchpath there. Now _-RunPythonScript Scriptname.py works from a button and the scripts are found when there is no path in front of the scriptname.
Defining the searchpath in the new script editor (under the IronPython 2) section does not work. Btw. i’ve tried Rhino Options > Files > Searchpaths too but that did not work either.
@clement Sorry for my late reply. I tested this on both macOS and Windows with both Rhino 8 SR27 and latest Rhino BETA. Both these command work when path is added to the Files > Search Paths.
i’ve tried to explain the problem in a PM with @Gijs. We never used to define script (module) search paths under Rhino Options > Files > Search Paths
Since Rhino 5 we did this directly from the _EditPythonScript editor. It worked in Rhino 5,6,7 and 8. I’ve written so many toolsets in the last years and if they where not compiled, because IronPython modules where not supported, they where all bundled with a help document. In this help document i’ve instructed the users to define the path to the scripts and modules this way:
This way it was possible to bundle a toolbar and every button in that toolbar was just using:
! _-RunPythonScript ScriptName.py
to run a script from the location the user has chosen. It also worked for modules. I’ve tried exactly this in Rhino 9 Beta when it came out, and it failed. After my report i’ve been called by some users still working with my scripts. They reported the same. It did not work.
Unfortunately i cannot change all my bundled help docs from the past and include a new way to “install” my toolsets. Therefore it would be great if Rhino 9 is not an exception.
@clement Please give me more context on the actual folder structure you have. I am confused as which is really not working. There are two sets of paths:
a) Module search paths in Script Editor options under python 3 or 2. This affects import statements in python 3 or 2 and these paths are added to the sys.path. Python runtime searched for module being imported under these paths in order.
b) Script search paths. These are scripts you have that need to run with _-ScriptEditor _R or _-RunPythonScript commands in Rhino. You’d set these in Options > Files > Search Paths. Then these commands can find the script by their name under these paths.
What is your folder setup, Rhino and Script Editor options setup, and which one of the two is failing?
the toolbars i’ve published in the past where all containing buttons with this code to run the script:
! _-RunPythonScript ScriptName.py
Defining the search path under _EditPythonScript was the only thing required to make the toolbar buttons work. The scripts called, used modules, stored in the same folder as the scripts. So if one of the scripts had something like this in the code:
from MyModuleName import MyFunctionName
the module was found and the script worked. Is this the information you need ?
I am not sure i understand that. I may have a different folder setup than my client. I’ve tried Rhino 9 and still use _-EditPythonScript if i write or edit IronPython scripts. If i use Python3 then i compile as PlugIn so the installation is done via yak packages. So for newer stuff it’s not a problem, i’m just trying to keep the old stuff (which i cannot edit, as it’s beeing published in the past) alive.
Hi @eirannejad, i’ve just wanted to verify if it now works in Rhino 9 Beta (9.0.26272.12303, 29.09.2026). After installing it, i rebooted, opened Rhino 9 and typed _EditPythonScript. This opens your new script editor, so the old one seems to be gone forever.
and added my searchpath. The searchpath has one space in it if that matters. I’ve then closed the dialog and restarted Rhino. After reopening Rhino i’ve opened my toolbar and clicked on one of the buttons. The code in the button looks like this:
! _-RunPythonScript MyScriptName.py
This does nothing. The script is not started. There is no error in the command history.
Can you repeat this ? Can you do the same in Rhino 5,6,7 or 8 to see the difference to Rhino 9 ?