Is there any reason why Blocks are not sorted by name?

I am asking because I don’t understand, I wish it was sorted but maybe there is a good reason for it not to? Thanks

These are sorted by name…

11 comes before 109, not after. :face_with_hand_over_mouth:

Windows explorer gets it right.
image

kuva

Again, windows gets it right.

I think Windows is making something extra so it’s more like a user would expect it. It recognizes that there are numbers after text fragment which is constant. It uses the end of the name as numbers. However, it’s not strictly sorting text.

Most users would number files like this: 8, 9, 10, 11
Instead of: 08, 09, 10, 11

Grasshopper example

Can’t wait for AI to replace programmers.

Ask a human to sort text, he will write 1,2,11 not 1,11,2.

1,2,11 is right. 1,11,2 is wrong, no matter what a computer says so. I couldn’t care less what a stupid computer says.

No they are not.

Maybe this will help.

Anyway, it’s not a good naming convention to have names such as yours in different lengths.

1 Like

AI says:

To achieve the expected numeric sort order (1, 2, 11), the text strings need to be treated as numbers. Computers can do this by identifying numeric substrings and sorting them by their numerical value rather than their character value.

For example, the sort would interpret “BLOCK GH_ELEVATED_11” as containing the number 11, placing it after “BLOCK GH_ELEVATED_2”.

Hope this helps for devs.

It would be great to have computers (in this case Rhino) sort text and numbers like a human would in 2024 if that’s not too much of a stretch. Thanks :innocent:

1 Like

To be fair, we must add, that Layers are sorted as you would wish, but Blocks are not. So this sorting difference inside one program is certainly something undesired.

image

2 Likes

That’s a good point. +1 to human sorting.

michael-scott-the-office

1 Like

seeing that the block names have “GH” these blocks probably came from GH you could just rename your blocks in gh to all have three digits and thereby solve your issue and simultaneously make the list easier to read.

hard to read a list that goes:
xxxxx.yyy
xxxxx.yyy
xxxxx.yy

much easier to read a list that goes:
xxxxx.yyy
xxxxx.yyy
xxxxx.yyy

You can pad your numbers using Format like so…

1 Like

I’ve added a note to RH-59136 Sort the list
-wim

1 Like