algorithmic modeling for Rhino
EDIT: This was the earliest release of the component. Now you can find the new more updated version here.
Hi all,
I've read this thread started by Benjamin and it made me look into integrating the new Rhino V5 Python interpreter into a Grasshopper component. After a couple attempts, it seems now to work well in V5. If you are eager to try again the Python syntax in Grasshopper, this should be useful.
This component will still need to be significantly improved with respect to features and performance, especially variable non-textual inputs, syntax editor and highlighting and parse-time error notifications would come in handy.
To install (the usual way), in Grasshopper 0.7:
I am also attaching the source code (in C#, TestPython.7z), in case you feel like having a look.
- Giulio
______________________
giulio@mcneel.com
McNeel Europe, Barcelona
Tags:
Replies are closed for this discussion.
import rhinoscriptsyntax as rs
strObject = rs.GetObject("Pick an object to select layer")
if strObject != None:
strLayer = rs.ObjectLayer(strObject)
Py_Res = rs.ObjectsByLayer(strLayer, True)
import rhinoscriptsyntax as rs
rs.AddPoint((0,0,5))
import math
import rhinoscriptsyntax as rs
ptList = [((math.cos(i*0.3),math.sin(i*0.3),i*0.3))for i in xrange(0,100)]
o = rs.AddPoints(ptList)
Py_Res = [rs.PointCoordinates(i) for i in o]
rs.DeleteObjects(o)
import math
from Rhino.Geometry import Point3d
o = [Point3d(math.cos(i*0.3),math.sin(i*0.3),i*0.3) for i in xrange(0,100)]
Py_Res = o
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