Creating a list of points

Hi, I am trying to make a list of start & end points of a selected polycurve. I am using a for-loop to iterate through each segment of the polycurve and add the start & end points to the list. If I print just the variable, it gives me just the points which is fine, but when I add them to the list, I get the something like – > Rhino.Geometry.Point3d object at xxxxx… before the point coordinates. Why do I get the extra info and how do I get rid of it? Thanks.

import rhinoscriptsyntax as rs

strC01 = rs.GetObject("Pick first curve", 4)
intNumOfCrvs01 = rs.PolyCurveCount(strC01)

pointList = []

for i in range(0,intNumOfCrvs01):
    dblCrvStartPoint = rs.CurveStartPoint(strC01,i)
    dblCrvEndPoint = rs.CurveEndPoint(strC01,i)
    pointList.append (dblCrvStartPoint)
    pointList.append (dblCrvEndPoint)


Here is the Output:

[<Rhino.Geometry.Point3d object at 0x0000000000000572 [2,3.25,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000573 [2,2,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000574 [2,2,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000575 [3.25,2,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000576 [3.25,2,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000577 [3.25,1.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000578 [3.25,1.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000579 [2.75,1,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057A [2.75,1,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057B [2.25,1,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057C [2.25,1,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057D [2.25,0.5,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057E [2.25,0.5,0]>, <Rhino.Geometry.Point3d object at 0x000000000000057F [3.25,-0.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000580 [3.25,-0.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000581 [5.00000000000007,-0.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000582 [5.00000000000007,-0.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000583 [6.00000000000008,-1.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000584 [6.00000000000008,-1.5,0]>, <Rhino.Geometry.Point3d object at 0x0000000000000585 [6,-2.5,0]>]

Hi Brandon, you might print the list like below to get rid of the type:

for pt in pointList: print(pt)


1 Like

That worked perfectly! Thanks clement!