import Rhino
import rhinoscriptsyntax as rs
crv = rs.GetObject()
pts = rs.BoundingBox(crv)
print pts
print "Point 1 is " + str(pts[0])
print "Point 2 is " + str(pts[1])
pointAdd = Rhino.Geometry.Point3d(0,0,0)
pointAdd = pointAdd.Add(pointAdd, pts[0])
print "Origin + Point 1 is " + str(pointAdd)
pointAdd = pointAdd.Add(pointAdd, pts[1])
print "Point 1 + Point 2 is " + str(pointAdd)
for i in pts:
pointAdd += pointAdd.Add(pointAdd, (pts[i]))
print pointAdd
Message: expected index value, got Point3d
Sorry… really basic one here. I don’t see where it’s expecting an index. At least, where it’s expecting an index I’m giving it one. Trying to get the centroid of a Bounding box. I was having some issues with ‘type’ earlier too. I think I’m just not treating methods/properties right.
All the print statements were just me checking I was at least doing the addition right. It’s the for loop which I’ve not defined very well.