Sort by rotation

Hello everyone,

I’m new to the forum and I recently started using Dynamo. I have to group some elements by parameter value, number them and then sort them clockwise/counterclockwise starting from a set point. As you can see I was able to group and number but I have a problem to sort them, I tried to sort by point coordinate but I don’t achieve the desire numbering.

Do you know a way to number starting from a point along a clockwise/counterclockwise path?

Thank you!
group and sorting01|690x198

Create a vector from the element point to the ‘center point’, and then find the angle of that vector and the ‘starting vector’ (say north for the sake of argument) using the Vector.AngleAboutAxis where the axis is the global Z axis. Then use a List.SortByKey node to sort the elements according to the angle values.

Many thanks @jacob.small, I’m tryng to do a vector between the “centroid” of the single element and the “centroid” of the whole model then I can do as you said sorting by angle between the vectors.

This should set you on your way: Dynamo Dictionary