[Grasshopper] How to use Sort List to reorder numbers and data in a list

[Grasshopper] How to use Sort List to reorder numbers and data in a list Grasshopper component EN

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

Sort List1
Sort List2

On the Grasshopper, it is represented by either of the two above.


↑Youtube Channel

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.

decreasing

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.

Reverse

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.

sorted in ascending order

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.

並び替えた数値に対応するデータを並び替える
Click to Zoom

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

Translate »