I wonder if this is possible. I have a GH “definition” that I would like to launch from a bat file which would run rhino as a service.
The idea is to be able to run Rhino/GH from a external app, but being “hidden” for the user.
After some googling, I found that there are applications that are able to lauch any app as a service, but this is not an option for me since it would complicate things for my ““plugin”” users.
The ideal solution would be to launch Rhino with some “magic” option from my bat file. Am I dreaming?
No, you are not dreaming. Start kicking the ball by invoking a “main” GH definition as described below.
Given the file “main.ps1” placed in the sub-folder “run” and the file having something like the following content (I keep the comments I had in my file, for your information);
# https://ss64.com/ps/set-executionpolicy.html
# Set-ExecutionPolicy -executionPolicy Unrestricted
# Call this script like so:
# powershell -executionpolicy unrestricted .\main.ps1
[System.Diagnostics.Process]::Start("Rhino.exe", "/nosplash /Grasshopper run\\Main.ghx").WaitForExit()
Write-Host "Rhino.exe has terminated."
And off you go.
I no longer remember if this invocation is hidden or not (it’s from 2018), but you’ll find out.
And of course on the desktop, you can use your own application framework to can into Rhino.Inside and Grasshopper as a DLL and run simple batch commands from there.
Yes. Compute or Command line. Inputs can be customized to be interactive or automatic in different contexts. Of course the devil is in the details and this is a developing set of features, so any feedback or results you are getting we would be happy to hear about.
It is also important to know that Compute can also take a series of “commands” and then return the results. This improves performance by reducing the amount of data sent back and forth.
Blockquote
[System.Diagnostics.Process]::Start(“Rhino.exe”, “/nosplash /Grasshopper run\Main.ghx”).WaitForExit()
Write-Host “Rhino.exe has terminated.”
Rhil, this is to launch Rhino from shell, right? But this is launching also the UI. What I was looking is to Rhino running as a “daemon”, without UI. Maybe “running as a service” its not the correct expresion?
Basically what I want is to launch Rhino and the grasshopper from illustrator to execute our ““not-a-plugin”” to make stuff in Rhino but with interaction from Illustrator. It’s quite a mess…
Rhino,Inside can run kind of like a daemon, but it is different. Because Rhino.Inside will load as a DLL inside any other program, You can create a simple application that acts like the shell, but is loading Rhino.Inside. In fact if that simple application can take commandline args, you can just add a series of commands to your shell.
Basically what I want is to launch Rhino and the grasshopper from illustrator to execute our ““not-a-plugin”” to make stuff in Rhino but with interaction from Illustrator. It’s quite a mess…