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

Python Sorted by X and after by Y

$
0
0

Hello,
I don’t understand the sort method in python, and i need today to sort geometry with the X value and the Y value… for example i select circles, and i need that python sort them like this:


i wrote this:
sorted_circles=sorted([(rs.BoundingBox(circle)[0][0],circle) for circle in circles])

but it’s only on X value…

I don’t find how i have to think about it… :exploding_head:

thank you!

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4148

Trending Articles