Organizing by position

hello everyone, good afternoon.

I’ve been working with dynamo for the last week and I’ve come across this situation a few times:

When I’m working with modules where they generate squares or polygons sometimes they end up returning not very organized lists, and to perform operations with these modules it would be better if they were grouped where they actually actually have position, for example I imported this group of squares from an alias file and when I open them within dynamo they are not organized by their real modules.

this is how the first 3 ids appear:

In this example I believe that what influenced the order of positioning of the lines in the list was my selection of input and send within the Alias ​​but I would like to know if there isn’t a way to sort them every time by their position with the other lines in the group.

After organizing these modules by position, and grouping them as a PolyCurve.ByJoinedCurve, I would still like to find a way to organize them from bottom to top in z and from right to left, which would look something like this:

I was thinking about using Geometry.DistanceTo in some way to test if the lines have values ​​== 0 but I couldn’t get it right.

this is the code so far:

these are the dynamo and alias files:
surfGroup.dyn (19.7 KB)
surfGroup.wire (87.6 KB)

Vector sorting might be better, allowing you to sort by say the Y and then the X value, or the X and then Z… or X then Y then Z… you could also look to pull the YV parameters at parameter 0 of the curve, and then use the U and V value to sort things (likely getting more consistent results relative to your base surface).

3 Likes

hi @andraderenan951
potentially something in link below

231212_PointListOrder.dyn (28.1 KB)



Cheers KS

2 Likes