Automating Grasshopper Part 2

Course or Collection: 
Software: 
Video Duration: 
10 minutes
Author: 
Zach Downey

In this tutorial we take a look at automating a couple of sliders to with Rhinoscript. We also use the GUID viewer to get the GUIDs of Grasshopper Components. This little tool is helpful becuase you don't have to copy and paste and dig through XML code to find the GUID you need. 

import rhinoscriptsyntax as rs
import Rhino
import time
 
#Load Grasshopper plugin as gh
gh = Rhino.RhinoApp.GetPlugInObject("Grasshopper")
 
#SetSliderValue("GUID",Number)
 
rs.EnableRedraw(True)
 
for i in range(0,3,1):
    gh.SetSliderValue("GUID_FOR_SLIDER_1",i)
    for j in range(0,2,1):
        gh.SetSliderValue("GUID_FOR_SLIDER_2",j)
        gh.RunSolver("FILENAME.gh")
        time.sleep(1)
Tutorial Files: 

Rating

Please rate this tutorial below. Thanks.

5
Average: 4.6 (12 votes)

Comments

hey, I found the tutorial very interesting but unfortunately I am not able to download any of the tutorial fils that are uploaded in the page. What can I do about it? thanks

Want to Contribute?

Want to be an author? Drop us a line here we'd love to have you.

Already have a video you'd like to post? Send us a link and we'll get you going.

:)