I have a RhinoCommon plugIn that is supposed to share data with Grashopper components. The solution is based on this repo.
I want to give the users a chance to develop a gh file, and once it’s ready, execute it automatically from RhinoCommon plugin by calling -GrashopperPlayer command.
Problem is that I don’t know the way how to stop the process. GH components are subscribed to event’s from the plugIn - so it recomputes every time some data change.
Does anyone have an idea how to do it?
@AndyPayne - is this something you can help with?
I guess I’m unsure as to what the problem is (or I’m just confused as to what you’re trying to do). You said you wanted to let users develop a Grasshopper file and once it’s ready that it gets executed by the GrasshopperPlayer command. Why can’t they simply type “GrasshopperPlayer” in the command prompt and select the newly made file? Or are you saying you want a Grasshopper button (or Component) to automatically launch the GrasshopperPlayer command with the active document as the select file? Is that the case? Or have still misunderstood what you are trying to do.
I will try to explain better on simplified example.
Let’s say I have a RhinoPlugin that takes all curves from specific layer and does some transformation of this data. Then, there is a GH component that is consuming these curves. These parts are connected together through a shared project and some events that Rhino plugin emits.
All that works fine. Users can build anything they want on top of that - they have access to GH component that has ‘live data’.
When they are done with development, I would like to have an option to execute the final GH file in the background. That’s done with GrashopperPlayer. Problem is, that after this command is called once, it never stops. Because the core GH component get updated data anytime something changes. And that’s my question - if there is some option to kill this GHPlayer process.
Does something like this file (see below) do what you’re looking for? Or are you somehow looking for an “abort/esc” option for the GH Player command?
Launch_GHPlayer.gh (5.3 KB)
Thank you, could I just have one additional question?
Is there a way how to call RunAsCommand from the background thread without blocking Rhino UI?