How to create a button in Rhino that launches a specific Human UI/GH script

There is no simple and straightforward way to do this, but a collection of tricks make it possible. I think @marcsyp is the world expert on this - he may have some suggestions. Here’s the basic approach:

  1. Associate a button with a command macro that launches your grasshopper file. something like this:
    -_Grasshopper _Document _Open "C:/PathToYourGHfile.gh"
  2. to launch Human UI, just leave the “Launch Window” component’s run input set to true - and set the window to be “Child of Rhino” so it remains while grasshopper is minimized
  3. use a c# script inside your grasshopper script to minimize the GH window (only way I know of to hide GH window without making it inactive) Grasshopper.Instances.DocumentEditor.WindowState = FormWindowState.Minimized;
  4. if you want to close grasshopper after you’re done, you can trigger something like the following with c# script with a boolean input called “close”:
    if(close) Grasshopper.Instances.DocumentEditor.ScriptAccess_CloseAllDocuments();

like i said - not ideal. but possible to get a reasonable approximation of what you’re after.

6 Likes