Hi, I tried to find information on, but I’m not certain if I understood everything correctly, I need to ask.
Is it possible to create Python application that will run Rhino&Grasshopper in the background and solve (built in or external) Grasshopper definition file?
I know how to achive far superior results using Grasshopper than my coding skills. I would like to have a small and quick Python application with GUI solving GH definitions in the background rather than opening full size Rhino and Grasshopper.
Also I could share this app with my collegues who don’t know Grasshopper.
(Note I’m not talking about Human UI or stuff like that)
There are all sorts of Python libraries such as rhinoinside.
But if you have no luck with any of those, it’s long winded but .gh files run one solution automatically when you open them if you haven’t first gone to Solution → Disable Solver (This is actually a huge arbitrary code execution vulnerability that should be closed by McNeel ASAP IMHO; fortunately no attackers have exploited it by shipping malicious .gh files that I’m aware of. Yet)
So for the time being you can definitely open a .gh file via Rhino command scripts, via Rhino’s command line interface. This is how I did it:
@ECHO OFF
cd dev
start " " "C:\Program Files\Rhino 7\System\Rhino.exe" /nosplash /runscript="-_grasshopper _editor _load _document _open C:\<path_to_your_GH_definition_file>.gh _enter _exit _enterend"
cd ..
Thank you for the tip, and yes I was trying with rhinoinside, I thought that would be the easies way to do it.
Now I’m trying your method but It loads whole Rhino and Grasshopper with UI and it takes a lot of time to do it. Way to long to perform some simple task.