algorithmic modeling for Rhino
Can external events (ie a remote server) trigger RunScript() output in GH C#? I'm hoping to implement a web API in a C# script, which pushes updates to the script. Dynamically passing variables from <custom additional code> events to RunScript(ref object whatever) seems like it would require an alternate signature for invocation. I've tried several approaches, but nothing worked:
a) I can't call RunScript() from custom code (Even with infinite-loop-protection), and
b) I can't get RunScript() to see updated variables without changing the inputs to the GH object.
This seems to be by design.
Alternately, could this be accomplished with an output --> input loop back? Is there an implementation of delegates that might work? Is constant polling from RunScript() the only way, and if so, isn't that cumbersome?
Or, would I need to ditch this approach, and import separately from the whole C# Script?
Big thanks, Bohmwave
Tags:
I think defining a delegate to call ExpireSolution() is the way to do this. My handle on events is iffy at best - maybe dig around in some of these threads:
http://www.grasshopper3d.com/forum/topics/non-blocking-c-plugin?com...
http://www.grasshopper3d.com/forum/topics/threads-expiresolution-pr...
http://www.grasshopper3d.com/forum/topics/how-does-read-file-watch-...
Welcome to
Grasshopper
© 2024 Created by Scott Davidson. Powered by