How do I install a custom GHX component?

I feel like I'm missing something obvious. I'm reading through the SDK documentation on how to create a custom Grasshopper component. I've created the class library, inherited from GH_Component, built the dll, and renamed it to a GHA file.

it is also possible to install by placing your gha file into the "C:/Program Files/Rhino/Plugins/Grasshopper/Components" folder and restart Grasshopper. But I think David would prefer custom components to go into the special components folder (where it goes if you drag and drop), for better long term plugin management.

1) If you're called David Rutten and about 1.95m high you're allowed to put the GHA file in <Program Files>\Rhinoceros 4.0\Plug-ins\Grasshopper\Components\

2) If you're a user who wants to install a GHA file written by someone else then you should put the file in <user folder>\Application Data\Grasshopper\Libraries You can either do so manually or drag+drop the gha file into Grasshopper and a copy of it will be placed in that folder (as you noted)

3) If you're a developer who wants to compile and test your GHA assembly, I recommend you add an additional GHA folder path to the Grasshopper loading sequence. You can do this via the _GrasshopperDeveloperSettings command. Any GHA file in any of the folders listed there will be loaded.

Note that if you compile the GHA files yourself, you'll end up with two different ones if you use the default Visual Studio setup. Namely one file in bin\Debug\ and another in bin\Release\, depending on the build flavour you pick at any given time. This is annoying. Really annoying.

I highly recommend you change the default behaviour of VS to always put the compiled file into just bin\ This will prevent Grasshopper loader conflicts.

ok 4) If you've written an installer for your GHA and insist on putting it in a custom folder (maybe next to an RHP file that belongs to the same project) then you can change the grasshopper settings xml file from within your installer. This is basically the same as adding an extra search path via the _GrasshopperDeveloperSettings command, but it doesn't involve starting Rhino.

do not put your files in the Components folder, that folder gets nuked when a Grasshopper update is installed. Either put it in %appdata%\Grasshopper\Libraries\ or use an RHI installer* or use a custom installer and put a *.ghlink file in the %appdata%\Grasshopper\Libraries folder.

We will try and load .NET dlls from all sensible locations, but I don't think we handle C++ dlls at this point. I sincerely doubt we'll be messing with environment variables (there's all sorts of user privilege problems there I think). If the dll you need is next to your GHA file, you should be able to load it yourself from a GH_AssemblyPriority derived class.

--

David Rutten

david@mcneel.com

Seattle, WA

* I'm not entirely sure whether this will work yet for non RHP installs, but this will definitely be the official recommended method soon