algorithmic modeling for Rhino
Unfamiliar with Rhinoscript enough to set a command alias in Rhino so I can type a custom command name and then have a Rhinoscript issue a Solution>Recompute command in Grasshopper when the solver is left disabled to free up Rhino use. This works fine via the Grasshopper menu. I don't know the appropriate Rhinoscript, nor how to save the script in my Rhino file and then link it to a run script command alias. Lots of homework for such a simple task. Ought to be in the manual, if there was one, thanks!
Tags:
This little python script does the trick:
import Rhino
gh = Rhino.RhinoApp.GetPlugInObject("Grasshopper")
gh.RunSolver(True)
Hi Nik,
Save the upper Andrew's code as a .py file (for example: runSolver.py)
If you save it to one of RhinoPython's "Module search paths" (RhinoPython's application menu: Tools->Options), you can define an alias like so:
import rhinoscriptsyntax as rs
rs.AddAlias("runSolver", "! _-RunPythonScript runSolver.py")
If you do not save the .py file to one of RhinoPython's "Module search paths", you need to define the path too:
import rhinoscriptsyntax as rs
rs.AddAlias("runSolver", "! _-RunPythonScript C:/runSolver.py")
Of course all of this can be done manually in Rhino (Rhino's application menu:Tools->Options->Aliases->New).
GrasshopperSDK help file generally lacks python related data.
Grrrr...this all requires an external file that other users on their own computers won't have. I'd like to include it as part of my Rhino document somehow.
Yep, that's an annoyance. The solution we use is to build installers that copy and deploy all scripts and uses a launcher button that adds the shortcut if it doesn't already exist on load.
It's a lot of work and not foolproof... but it works.
Marc
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by