Sort Column by two Keys

Hi Everyone,
I want to automate the column naming by using the type Parameter “Description”.
My problem is when i want to sort it by the dimension the sort is not correct because it fill the colmun 20x100 before the 20x20.
How can i handle this problem.
I try to cancatenate the two dimension but it seem it doesn’t work.

Changer Description Poteaux Automatiquement.dyn (21.8 KB)

Strings and numbers follow different sorting rules. You’re dealing with strings but want to sort by numeric value, so you need to break down the dimensions and convert them to numbers to sort accordingly.

There are also a couple custom nodes that use “natural sorting” which tends to more appropriately match numeric value sorting within strings. You can try looking for one of those.

I’ve finaly found the natural sorting of Orchid Custom Node.
It works for a circumtance.
But now if i have Circular column, how can i sort the radius inside others dimension. The custom node fill it after the others.

It would help what Parameters are used for the dimensions?
‘Width’ and ‘Depth’ for rectangular columns?
But also ‘Width’ for circular columns? Or do you use ‘Diameter’ then?
Also what is the order for the shapes. Rectangular first?

1 Like

That’s where it would help to get just the dimensions and sort that way. Rectangular would have two dimensions and round would have one. You’d sort/group by the first value and then sort by the second value in each subgroup.

I use Width and Depth for rectangular column and Diameter for round column.
The order should be the first dimension and the second after.
So th round column will be Diameter by Diameter.

Can you show me an example?

Something like this.

I tried you codeblock but it’s telling me associative_factor incorrect.
And can you explain what’s doing.
I’m new to dynamo

It’s just an example. You’ll need to show what you have and what it’s doing.

Let me send you the project file and the dyn file in the link below.

https://cacosn-my.sharepoint.com/:f:/g/personal/mhady_diallo_caco_sn/Eli6RA90JMxJt0Zinh3EZP4BD6Fpfig6LLoWpk9-tkXgBA?e=fMZgZD

You’re much more likely to get help by just showing some screenshots and providing the necessary information to accurately describe your situation. Even with a project and a DYN, we can’t troubleshoot or give feedback if we don’t know what exactly it is that you’re after.

I finaly manage to find a solution.
I sorted and group the type by the first dimension.
And I sorted the latter by the second dimension.


Thank you for your help.