Categorize a bunch of horizontal curves according to their Z value

Hi everyone,
I want to categorize a bunch of horizontal curves according to their Z value.
First I got the Z values of all the curves. Then I culled the duplicates and sorted the list. Then I tried to dispatch the curves using the criterion of equality of the Z value with the list obtained. But it did not work. As you can see in this example I have a total of four curves, two on the upper level and two on the lower level. The result shows the first branch to have two items and the second branch to have only one item.
I tried to punch in the Z values manually and do the process again. This time it worked!
I suspect that it has something to do with the tolerance of Rhino. But I’m not sure. As you can see, some times the output is shown as 10 and sometimes as 10.0.
Any idea why this happens and how I can solve this issue?
Maybe there is a better way to categorize these curves…


Thanks
Bahram

Sort Curves By Z.gh (15.3 KB)

Hi @Bahram_Azizi

First use “set” instead of “duplicate points” then use “member index” in combination with “list item”.

1 Like

Your first method works when you add an expression to the pDecon ‘Z’ output: round(x,3)

This is also common using the second method (white group) because text panels don’t show very small differences that will cause both methods to fail.


Sort Curves By Z_2024Mar28a.gh (16.7 KB)

1 Like

Thank you @Erik_Beeren !
It is much better practice the way you explained.

Thank you @Joseph_Oster !
You made my life a lot easier!

Thought I’d add a ‘sort list’ to your solution to have an ordered list and post it for posterity.

Sort Curves By Z_2024Mar28b.gh (11.4 KB)

Hi @Bahram_Azizi,
It will work also like this:


Sort Curves By Z_2024Mar28b.gh (15.9 KB)

1 Like

Awesome. I really like the way you did it. It’s easier for me to understand.