Order list on 2 items (size and length)

Hi all,

I want to order my some pipes by size and length, to number them for prefabrication.

blue 1: this is my list with pipes
blue 2 and 3: this are the lists with the size and length.

blue 4: this is the list I need.

I need them to be sorted by size and then the sublists of each size needs to be ordered by length.

If you look at blue 4: the green *1 all are same lenth, so order may be anything. The green *2 are different length, so order needs to be in order.

Hope I make myself clear.

I tried a lot already (SortByFunction / SortByKey / … / …)
But can’t get it accomplished… the sort functions still give me a lot of headache lol…

this are the pipes for explanation

Sort by length first, then sort by size. This will return a flat list from the shortest of the smallest size pipe to the longest of the largest size pipe. This is done with a pair of List.SortByKey nodes.

If you want to have them grouped by size, swap the last of the List.SortByKey nodes with a List.GroupByKey node.

2 Likes

hi, too late

cordially
christian.stan

2 Likes

Thank you!
The sort/group by key issue still not 100% clear to me… I think I go watch again some video’s on YouTube about it soon :wink:

2 Likes