import Rhino import rhinoscriptsyntax as rs crv = rs.GetObject() pts = rs.BoundingBox(crv) print pts print "Point 1 is " + str(pts) print "Point 2 is " + str(pts) pointAdd = Rhino.Geometry.Point3d(0,0,0) pointAdd = pointAdd.Add(pointAdd, pts) print "Origin + Point 1 is " + str(pointAdd) pointAdd = pointAdd.Add(pointAdd, pts) 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.