I want GrasshopperPlayer to execute my script only once, currently it stays in grasshopper cache and update itself on component change.
Joined a simple script that get a block’s Id and place a text at the box center point.
When I call that script from the _GrasshopperPlayer Rhino command it works, BUT when I move the object, the scripts updates itself, and the text is bake again.
I figured out that when I disable the solver, it’s working perfectly fine, but I it’s really anoying to keep the solver disable.
Are they any way to make the solution expire just after it’s execution ?
Maybe something with scheduling solution ?
Otherwise, do you plane to make a getBlock component one day ?
I know that this problem has certainly been solved when the grasshopperPlayer is turned into a command using the RhinoScriptCompiler (! _Run RhinoScriptCompiler).
I found a solution ! To launch the script from another grasshopper. See here
This came up in private tech-support, may be useful for others as well.
The attached Runner.gh file loads another gh file (example provided), sets a value to a parameter named “INPUT”, runs it, harvests the data in the parameter called “OUTPUT” and then outputs that as its own data.
Runner.gh (6.1 KB)
AutoFile.gh (9.1 KB)
I’ve explored as well hops plugin.
But it is not really fitting my need
Thank’s for your answer, Hops would have been a great solution. But it seems not to be working with object referenced by id. The reference is not retrieve within Hops.
To use blocks in Grasshopper it is quite usefull to consider their ids.
Furthermore, It is impossible to have some script interacting with Rhino interface.
The Runner.gh script above is working with both ids and python code.
blockCount6.ghx (75.5 KB)
grasshopperCache4.ghx (56.3 KB)
Here is another version of this grasshopper using python script instead of an external plugin
text_only_once-ghp_cache_issue.ghx (78.7 KB)