This article explains how to use Sort List to reorder numbers and data in a list.


On the Grasshopper, it is represented by either of the two above.
Sorting the numbers in the list in decreasing or increasing order
Using Sort List, you can sort the numbers in the list in order of decreasing size or increasing size.

First, we will explain how to sort numerical values in order of decreasing size.
Connect a list with numerical data to the Sort List(K).
The numerical values in the list are then sorted in decreasing order and output from the Sort List(K) on the right.

Next, we will explain how to sort the numerical values in ascending order.
In this case, right-click on the Sort List(K) on the right side and set it to Reverse.

When set to “Reverse,” the order in the list is reversed, and the numbers are now sorted in ascending order.
Sort the data corresponding to the sorted numerical values
You can also sort the data corresponding to the sorted numbers.

Connect the data corresponding to the Sort List(K) value to the Sort List(A).
The data will then be reordered in the same way as the reordered numbers.
In the above image, the numbers 2 and Ramen were originally first, but since the corresponding number is 2, they have been moved to the second position after being reordered.
List of Grasshopper articles using Sort List component↓




Comment