Grasshopper Player - Script Complete Event?

Is there an event which is passed by a script that is running through the Grasshopper player, which lets Rhino (or Revit, when running as Rhino Inside) know that the solution has completed and to close the script?

I am working on some scripts that use Human UI, but the GHplayer thinks that those scripts are finished running before they actually are. I was thinking of building a component to intercept the event or somehow otherwise signal that the script should continue running until the user has made all their selections.

I’ve checked the developer documentation but it seems a little sparse when it comes to the Grasshopper Player, so any insight from the development team would be a huge help. I am comfortable writing either a custom c# component or using a C#/ python component (whatever is needed).

I suspect the answer may be some combination like…
If running as command (link) && window.HasChildren (link) then… something.

This is semi-related to this post:

Hi Matthew

Did you find a solution for this? I have the same issue…I loading in data from a excel sheet to Human UI components…then the script performes geometry operation…but after the script is complete i need to decouple the excel data stream to the human Ui components…

Morten

Have you tried just adding an extra superfluous input at the end so that you can wait the extra time needed for the script to finish yourself?

Hi Matthew,

I’m interested to know if you’ve found a workaround to this. In my case, GH player launched Human UI for a duration of less than a second and I didn’t even get the chance to commit any input.

No dice, unfortunately. I ended up just going the full pyrevit route.

I’m also here looking for a way to know when a grasshopper script has ended, although I want it to work within Grasshopper. I’m trying to save off a screen grab each time a script completes.

As I’m typing, it occurs to me that a script would have to become somewhat self-aware to do that, but grasshopper seems to know when it’s done solving and how long the solution took, so there must be a flag right?