Grasshopper

algorithmic modeling for Rhino

Hi Guys,

Is it possible to write a VBasic Script, that can open Rhino and after this Grasshopper?

That would be very nice!! :)

Have anybody an idea??

Regards

Henne

Views: 701

Replies to This Discussion

Hi Henne,

I don't know how to do it with VBScript but you can do it with Python from the command line.

I have evaluation version installed on my laptop. The Rhino folder on your system might be different. You need to modify the command line. This will open Rhino and execute a Python file that opens a gh script:

C:\>"C:\Program Files\Rhinoceros 5 Evaluation (64-bit)\System
\Rhino" /nosplash /notemplate  /runscript="_-RunPythonScript thePythonScript.py"

Here is how the Python script looks like

ghFilePath = r"C:\somefolder\somefile.gh"
import clr
clr.AddReferenceByName("Grasshopper")
import System
import Rhino
import Grasshopper
from Rhino import RhinoApp, RhinoDoc
gh = RhinoApp.GetPlugInObject("Grasshopper")
gh.LoadEditor()
gh.CloseAllDocuments()
gh.HideEditor()
gh.OpenDocument(ghFilePath)

Here's some C# code that does this if it helps

https://github.com/sbaer/AutomateRhino/blob/master/console_cs/Progr...

I wrote a script to automate this for optimization/automation purposes, called GrassBot. It's in alpha mode, but here's a binary:

https://github.com/provolot/grassbot/raw/master/bin/Debug/GrassBot.exe

and some more info here:

https://github.com/provolot/grassbot

it opens Rhino, opens Grasshopper, loads a specific file, bakes a node to geometry if desired, takes a screenshot if desired, and closes Grasshopper/Rhino.

Thank you Guys. Its very helpful!!!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service