Packaging a grasshopper cluster as a Rhino Command

Possible solution: Use a Rhino.Commands.Command object to control the GH kernel; Cache the kernel to accelerate the command.

  1. On the first call:

    • Init the GH kernel, load the network
    • Cache the kernel in the doc’s User Objects, to avoid the Kernel init on subsequent command calls
  2. Subsequently:

    • Get the cached GH kernel
    • Collect the user input
    • pass input to the GH kernel
    • tell the GHkernel to bake the result to RHobjs
    • Send the RHobjs to the RhinoDoc

@DavidRutten do I recall that you wrote a guide on essentially the same steps? If I am not mistaken, can you help me locate that note?

Other questions:

  1. Does my solution sketch omit any steps?
  2. Is the current doc’s User Objects the right place to persist the GH kernel?

Thanks David, Wim!

– Max
(Teakomatic)

1 Like