algorithmic modeling for Rhino
Hi!
I know it possible to set a slider in Grasshopper from a Python script (see below, gh.SetSliderValue(" ")), but is it possible to get the output value of the Grasshopper script back to Python?
Regards,
Stijn
import rhinoscriptsyntax
import Rhino
gh = Rhino.RhinoApp.GetPlugInObject("Grasshopper")
#SetSliderValue("GUID",Number)
gh.SetSliderValue("c70bd93b-749b-42d2-aee2-bb5e97cf473d",5)
Tags:
Hi Stijn,
When you say Python, you mean: RhinoPython editor?
If that is so, then at the end of your ghpython component, you can send the output to sticky dictionary:
a = "someValue"
sc.sticky["ghpython_component2_output"] = a
Then in RhinoPython editor, you can read the value you assigned to the mentioned key:
try:
a = sc.sticky["ghpython_component2_output"]
except:
print "no value has been assigned to \"ghpython_component2_output\" key"
Hi djordje,
Thanks for your reaction, but i'm not sure we are talking about the same thing.
I am not using a ghpython component in Grasshopper, but i loaded the Grasshopper Plugin into RhinoPython editor.
In the link below they manage to automate the sliders, but now I want to load the result from Grasshopper back to RhinoPython.
http://www.designalyze.com/course/automate-grasshopper-python
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