GH Player: How to test and debug files?

I love what you can do with Grasshopper Player in building our own Rhino commands. Also surprisingly great, even though its basically a command line tool, is the Script Compiler in Rhino. With that we can compile different scripts and .gh files to create like a plugin for ourselves.

So far so good.

For something like Python scripts, it’s really easy to debug, run, debug, run, etc.

But for Grasshopper Player files its surprisingly difficult to test run them. Sure you can run your file in Rhino using Tools > Grasshopper Player, but its completely running in the background.

Even though you might have the .gh file open in Grasshopper you cannot simulate running it while seeing the data in the Grasshopper Editor.

So similar to how you test run a python script, why not a test function for Grasshopper Player?

I imagine there could either be a function in Grasshopper under Solution called “Run in Rhino” and it runs the currently open file as a grasshopper player file in Rhino, but we can sort of follow along in the Grasshopper window and see the actual data.

Alternatively we could have a function in Rhino to select a running file in Grasshopper to execute as Grasshopper player.

I am aware that probably its not quite so easy because the .gh file probably gets compiled in some way, but it would make debugging and testing so much easier or rather it would make it possible.

Has anyone found a good workflow to debug Grasshopper Player files and actually be able to see what’s happening?

One okay way to debug picking Geometry I found is using the ObjectsBySelection component from the Human plugin, but its not quite the same as actually selecting Geometry. I needed to get the geometry in the order they were picked and I had to use Python for that in the end.

There must be a better way…