algorithmic modeling for Rhino
Hi Carcassi,
"i" is going to be 0, 1, 2, .. len(pts). You have an array of points "pts". So pts[0] will be the id of the first point and so on. Now I assume you would like to reset the "x" value of each point to be 0.5.
Here is how you can rewrite your code sample
import math
import rhinoscriptsyntax as rs
pts_ids = rs.GetObjects('pick points',rs.filter.point)
for i in range(len(pts_ids)):
point = rs.PointCoordinates(pts_ids[i])
if point:
print point
point[0] = 0.5
print point
#another way to write the loop:
for id in pts_ids:
point = rs.PointCoordinates(id)
if point:
print point
point[0] = 0.5
print point
I hope this helps
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