October 19, 2016, 1:56pm
Hi, I need to remove an item from a list of points, but I get the error that ‘Array[Point3d]’ object doesn’t support item deletion.
So what should I do?
(I am going to trace some points in a pointcloud)
import rhinoscriptsyntax as rs
index = rs.PointArrayClosestPoint(ptList, point)
print str(index) + " : " + str(ptList[index])
You can either convert a point3dlist into a normal list using
list(your_point3d_list) or use the
October 19, 2016, 4:09pm
Thanks Mitch, I didn’t think of the option to just put the list in another list. Clever.
So the list(3dpointlist) solution worked. List.RemveAt(index) didn’t, it threw something like a “list is fixed length” error.