Update grasshopper query objects or recompute - with a Rhino alias

Hi,
I’m trying to create an alias that would recompute my grasshopper definition. Even better, if I would be able to just have an alias to “press” on the query button of the query model objects function of grasshopper ?

Any ideas how I could achieve any of this ?

1 Like

If you are looking to just recompute your definition press F5 in Grasshopper.

Hi,
Thanks for your answer,
I’m updating kinda often, so always opening grasshopper clicking f5 then going back to rhino is kinda slow…

Try running this single line macro on a Rhino alias/keyboard shortcut:

-RunPythonScript (import Grasshopper as gh; gh.Instances.ActiveCanvas.Document.NewSolution(True))

1 Like

Thanks a lot for taking the time to answer,
Sadly it doesn’t seem to work… ?

Seems to works (in Rhino 7):

hey,
So it indeed works with your example of a simple recorder, but it seems it doesn’t work to update the “get objects” definitions

You probably need to post some files. But just to double check, does recomputing the Grasshopper canvas (e.g. by pressing F5, right-clicking the canvas and selecting Recompute, or going SolutionRecompute in the top Grasshopper menu bar) achieve what you describe as “recompute my grasshopper definition”? And the Python macro I posted above does not?

Yes I should try to send you a simplified file.
But seems like I found where the problem is : The cache function (in push mod) doesn’t update with this script (it does with f5 or right-click recompute)