Hi all,

I would like to use Python to re-organise in a clock wise order all the nested lists of points within one list.

I have several nested lists of points sorted by level and I was trying to use python to sort points on each level in a clock wise order.

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
import math
pt = IN[0]
newTupla = []
for tupla in range (len(pt)):
newList = []
sortedList = []
x = 0
y = 0
# calcs the medium point
for i in pt:
x += i[0]
y += i[1]
x = x / len(pt)
y = y / len(pt)
med = [x,y]
#calcs the arc tangent for each point
for j in pt[tupla]:
rads = math.atan2(-1*(j[1]-med[1]),j[0]-med[0])
rads %= 2*math.pi
degs = math.degrees(rads)
newPoint = (j[0],j[1],j[2],degs)
newList.append(newPoint)
#sorts the list using the angle
newList = sorted(newList, key = lambda x : x[3])
#removes the angle from the list
for j in newList:
newPoint = (j[0],j[1],j[2])
sortedList.append(newPoint)
OUT = sortedList
```

Does someone have a solution for that?

Thank you for your time !