Distribute Grasshopper scripts with a traditional plugin

I have a plugin written in C# that has a simple installer. (Mac and Windows). I also have developed some ancilary grasshopper files that would be useful to my plugin users.

The grasshopper scripts are a mix of grasshopper python components and other grasshopper components. So far I have just distributed the *.gh files and asked my users to open them manually.

Ideally I would like these to be distributed alongside my plugin so my users can easily access them.

1 Like

Do you include the .gh files in the installer, or do your users download these as a separate step (not clear from your description)?
I’m not sure we have any ‘best practices’ for this, but this is a good opportunity to discuss it. I think @piac distributes some sample files with the Weaverbird plugin. @piac Is that approach something that would work in the short term for @Jack_Minardi?
In the long term, for GH2 and RhinoWIP, we should consider some mechanism to add example files from plugins. In Rhino for example, one could add a file path to the File Explorer:

For GH, we could add an area in the File menu:

I like the way Processing and Arduino IDE have sample files. A library has a folder in the package called “Examples” there devs can add scripts. The addition of this path to the examples menu is done automatically:

@stevebaer @dale @will @DavidRutten Does it make sense to consider some sort of extension to the .rhi system that includes the ability to discover if the RHI has an “Examples” directory, and if so, register it somewhere in the Rhino UI if there is an rhp that exposes some functionality? Same for GH if there is a gha? We would have to consider how devs distributing without an RHI can participate in adding examples for their plugin.

1 Like

I don’t think so. Seems like something very custom that we’ll break. I can see some SDK access so the rhp or gha can register examples, but not the installer engine itself.

Hey @fraguada thanks for the detailed response. Currently my users download the GH files as as separate step and store them on their computer.

I really like your suggestion of copying Arduino’s “Examples” collection. When I’ve worked with Arduino previously this has been a very seamless experience, and a great way to quickly get up and running with a new library.

@stevebaer I think as long as there is some way to register examples that would be nice, I don’t really need it through the installer engine.

As a related follow up question, what is the best way to distribute python scripts as custom commands with my plugin?

Hey @Jack_Minardi, this should help explain the process…

One thing to note… A set of python commands counts as an individual plug-in. We don’t support multiple plug-ins per RHI installer, so this will have to be a separate RHI to your main plug-in. If you’re rolling your own installer, than you can do whatever you want :slight_smile:

Ok thanks for the info. Would is be possible to hook into the main plugin install and run a script that just puts the python files where they need to be?