Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5860

Sorting a list in alphabetical order

$
0
0

Hi,

I’ve got the following script:

import rhinoscriptsyntax as rs

dot = [ ]
dot = rs.GetObjects()

for i in range (0,len(dot)):
    a = rs.BlockInstanceInsertPoint(dot[i])
    b = rs.MoveObject(dot[i],(-a[0],-a[1],-a[2]))
    c = rs.MoveObject(b,rs.GetPoint())

I created this to faster move the below letter dots to desired locations. All of them are blocks with the same name as the letter i.e.: letter dot A is called “A” block instance etc. The problem is that the script randomly picks the letter dots, rather than in an alphabetical order. How can I sort my list or do a different work around?

Letter dots

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5860

Latest Images

Trending Articles



Latest Images