algorithmic modeling for Rhino
Hello All,
I am relatively new to GHPython and Python Coding, in general. I wanted to create a Boolean Trigger/Toggle operation that if triggered to 'True' it would prompt the user to select a single surface from the Rhino document and output to use it through the rest of the Grasshopper file. I am not sure if I am approaching this correctly, however I have attached the code I have tried to run based on my investigations about python:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino as rc
if x:
srf_obj = rs.GetObject("Select the Surface", False, True)
a = srf_obj
print a
else:
a = "False"
print a
I would appreciate any guidance, thank you.
Tags:
I figured it out, however here is the ghpython script if anyone is interested in using it:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
if x:
sc.doc = Rhino.RhinoDoc.ActiveDoc
sel_srf = rs.GetObject("Select a single surface", 8, False, True)
sc.doc = ghdoc
a = sel_srf
print a
else:
a = "False"
print a
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
© 2024 Created by Scott Davidson. Powered by