How to do relative file paths in a plugin folder



I’m new to this so please be patient. I am creating a custom toolbar for a client that will be distributed out to multiple users across the enterprise. Some of these buttons contain Python code and others >Open / Import 3dm files and load .gh scripts. The desire is to have the lot of these files and scripts in the rhino/plugins/rcmsub folder. I would then bundle everything into a .rhi for distribution.

What is the path to call these files / scripts from a tool button?

When I release a new .rhi will it overwrite previous files with the same name?

Is there a way to automatically clean out the /rcmsub folder before loading in the new files?

Many thanks for all input.

(Will Pearson) #6

Hi Robb,

I’ve had to give this a bit of thought since it’s not a use-case that I’ve come across before!

I have a suggestion, but ultimately this is not something that the Rhino Installer Engine was designed to do!

You could create a plug-in which acts as a proxy for the commands that are called by the buttons. For each button you would have a custom command which – using a similar technique to deploying toolbars – could figure out where the .RHI had been installed and find the scripts/files. You could then run the Rhino command from your custom command.

As a bit of background on the Rhino Installer Engine, consider a .RHI with the name “awesome plug-in” and the version “1.0.0” being installed for Rhino 6; this would be installed to %APPDATA%\McNeel\Rhinoceros\6.0\Plug-ins\awesome plug-in (<unique id>)\1.0.0.

Alternatively, I’d suggest exploring a different installation framework, such as MSI.


Thanks for the input Will.

I think I understand the idea you are proposing but I definitely could not go from the code in your links to an app without aid. I am an advanced novice in Python and WinForms but have no experience with C or VB. Do you have any thoughts on doing this in Python? Is there perhaps something complete that I could put under a button that I can use with my file names located under the Plug-Ins\ directory?

My goal is to institute a methodology that installs scripts, templates and other resources to a standardized location for use in Rhino that does not require Administrative Rights to execute. These would be periodically updated and distributed across the enterprise by emailed link for download and install by the user - not requiring IT involvement. i’m pretty sure MSI requires administrative rights - which is denied to the users in this corporation. And I could be wrong about any of the above…


Bump - Does anyone have additional thoughts on this?

TIA Robb