I am getting the point name and its co ordinates of a 3D point in my workspace then want to sort by either of the fields. What would you recommend ? a list or tuples if so is there an easy way of making either set of data to sort it. I have looked at lists and lambda values would this be the easiest way. Dont think my list is working in the example below.
import rhinoscriptsyntax as rs
MeasPts = [ ]
objectIds = rs.GetObjects("Pick measured points", rs.filter.point)
#for id in objectIds: print "Object identifier:", id
for id in objectIds:
objectname = rs.ObjectName(id)
if objectname is None: rs.ObjectName(id,"No name")
objectname = rs.ObjectName(id)
objectcoord = rs.PointCoordinates(id)
print objectname,objectcoord[0],objectcoord[1],objectcoord[2]
3 posts - 3 participants