Python projection but got an array

I am trying to project all points of the circle onto the brep, but I got an array and I do not know how to access the array to select the first projected.
What am I doing wrong?
Thanks in advance for your response.

20190117 problem project points 00.gh (12.5 KB)

it seems that each projection of yours will produce two points.
so you just need to subscribe once more
projPoint_listPt[0][0] and projPoint_listPt[0][1]

1 Like

If you want to pick a nearer one, you can use sort.

ss=sorted(projPoint_itemPt,key=lambda P:(prPoints_listPt[i]-P).Length) #sort using the distance
projPoint_itemPt=ss[0]  #pick the nearest point

By the way, P and v are exactly same in the below code

for i,v in enumerate(listPt):
    P=listPt[i]

So you can write

for v in listPt:
    P=v

Also,

for i, v in enumerate(listPt):
    P=listPt[i]
    Q=anotherlist[i]

is equilavent to

for v,q in zip(listPt,anotherlist):
    P=v
    Q=q
2 Likes