Grasshopper

algorithmic modeling for Rhino

list order - ranking for a list! need help! Thx a lot

Hello grasshopper-friends

I hope somebody can help me with this problem:

I got a list of different datas, and wanted to rank the values from maximum to minimum and get them a new value, but keeping the same order of the list. for example i have a list with 4 different lenght of curve like this:

0=  10

1= 12

2= 8 (minimum)

3= 17 (maximum)

and wont to make a ranking that the longest curve gets the value 4 and the smallest the value 1
, like this

0= 2

1= 3

2= 1

3= 4

i tried the sort list function, but it dosn`t work

can anybody help me!

thx a lot

Views: 936

Attachments:

Replies to This Discussion

the Sort Component is the component for this but you need to use the Synchronous sort input A on your series

 

thx for answering so quick. my problem is that i dont know how many strings my previuse skript will put out (three was only for example), and i dont will split my list in separate list, is there not another possibility? thx

The Entwine component is only for me to create a multi list tree structure as I don't have the curves you do. This approach i.e. creating a series based on the length of your lists and the Sort component will work on anything you throw at it.

i thried it out, but it doesn´t work, look at my image, the value (1:2) should be the maximum but after sorting it gets the value 1 and not 5. It´s the same problem like in your picture the value (0:1:0:0:1) should be the maximum 5, not (0:1:0:0:0)???

Attachments:

Remember you are changing the order of your list.

Here it is without changing the index numbering to start at 1

Is this what you are after:

oh yes, it was exactly like that, what i was looking for, thx a lot
great, now i`m done for today, and can enjoy my "free" time ;-)

thx thx thx, have a nice evening

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service