Lexicographic sorting


How can I sorting coordinates in lexicographic fashion on Dynamo?

Which nodes I can use for this?

For example, I have coordinates extrated from “location.point” property on families (e.g.: walls). So, I need sorting these coordinates and after fill the Mark property of these families.

Any suggestions?

Is this what you’re after?

Hi @Yna_Db!

This post is using Python and Design Scripting for solve lexicographic sorting.

Its my impression, or this problem can be solved only with textual languange?

How can I solve this problem using only standard Dynamo nodes?

There are other solutions to the issue exposed in the same thread, but for a better understanding of what you seek, an illustration would be welcome :slight_smile:

Well, I have some walls that I need sorting in clockwise order, like show in the figure below. I’m using the “Mark” property to put the wall number.

In this case, whats the better solution?


Just thinking here,
Find the centroid of the combined walls, create vectors from the centroid to the midpoint of each wall, sort the vector angles to Y vector, use geometry closet point?

I think I was able to solve my problem using the graph below.

Logic works, but two warning messages are popping up. How do I avoid these messages?


AutoNumeraçãoParedes-R00.dyn (17.6 KB)