Grasshopper

algorithmic modeling for Rhino

hey guys!

how to set up the right culture in the text sort component to sort the text right.

here is a picture of my wrong result:

i want to have the text sorted like this:

TS A.1

TS A.2

TS A.3

...

TS A.10

TS A.11

TS A.12

TS B.1

TS B.2

TS B.3

...

TS B.10

TS B.11

TS B.12

any ideas how to solve this problem?

thanks a lot!

bea

Views: 3599

Replies to This Discussion

It's not a cultural thing. You want to combine two sorts of sorting. You want the first 5 characters to be sorted as text, and the numbers to be interpreted as a number. The easiest way to solve it is to use trailing zero's, eg:

TS A.01

There may be a slightly more succinct way of achieving this, but this gets you there:

Attachments:

Actually, nicer with it all in the one expression component "Left(x,y)&Format("{0:0#}",Int(Right(x,Length(x)-y)))":

Attachments:

Sweet!  And sweeter still if you pass the "values" along and display them, using 'V':

thanks a lot guys!!!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service