Rhino 8 provided the ability to link to an RUI file on a network location so that we can have a central file we can update and add new buttons to and those updates will be pushed to all the people in the office that have imported that toolbar. In our testing it has worked great and has provided so much flexibility in the kinds of scripts we implement, whether they are macros, python scripts, and even python scripts that run grasshopper scripts. So far so good!
But, I am just now discovering it might not be possible to assign aliases to these buttons? We are trying to implement a solution similar to pyRevit for Revit where scripts can be run as buttons and shortcuts can be assigned to those buttons. But is this not possible in Rhino?
The solution seems to be to make an alias that has the same script info as the button, but that cannot by pushed automatically with an RUI update and thus is not as useful. Plus the work to get custom tools set up is duplicated. And we could go the route with a proper rhp plugin type thing, but doesn’t allow us to make corrections to scripts on the fly and have the updated script immediately available to rerun (which happens often because I feel like I am always just fumbling my way through script writing)
Am I missing something or is there a better solution?
Ok looking into it more, the implementation of projects in the script editor might be the way to go. Looks pretty hot-off-the-press so I’m excited to dive into it. My thought is this: Make a plugin that has the commands and buttons to go with them that we want to publish to the office. These commands would essentially be bare bones scripts that call our other scripts located elsewhere on the server, but this allows us to use command line to run them. This way we could update those scripts as things break and the user would be able to take advantage of the updates without the need to install an updated package every time a script changes.
Maybe not the cleanest way, but might be a good solution for amateur script writers working on an internal plugin that requires great flexibility for correcting scripts. This gets us a solution that’s close to how we utilize pyRevit as well (Thanks to the amazing Ehsan for both of these amazing tools!)
Ok I have a lot of questions about toolbars in regards to packages developed in the script editor so I’m going to post them in hopes someone can help.
When publishing a project, the rui file is created. Cool. How do I customize that? I can add macro buttons to it via editing it in Rhino and resaving, but this brings other problems (see point 3). Is it advisable to instead translate the macro commands to python to make a proper command?
This great post details some workarounds regarding order of buttons. Can there be an easier way they editing the files directly? And how do I add separators?
After i have edited the rui file, how do I get it back into the yak file? Would be great if there was a toolbar editor as part of the script editor for plugins. Maybe that is in the works. Otherwise it looks like I might have to compile it manually?
I know other packages have toolbars that look customized with separators and whatnot, so I think its just a matter of me not understanding how to do it, so any pointers would be greatly appreciated!