I have a number of contour lines and I want to make two different lists from curves. The selection I want to be with step 2 which means 1st list I want to consist of 1,3,5,7… curve and 2st list of 2,4,6,8…
For achieving this I thought to use 2 series components with step 2 and different start curve. My problem is that the curves are not sorted in the list and I would like to be sorted by the height from the 0 (Z-axis distance). Another problem I have is that for a specific distance on the Z axis, for example, 5m maybe there are more than one curves that must be at the same index on the list in order to work correctly the series. Is there another way to do that? If not how can achieve this sort of curves?
Yellow Coker-0ne !!
All you need is sort list component to give it a key like (sorted Z values of end points) , and get your curves sorted . Sorted list by Z value.gh (3.1 MB)
But there isn’t uniformity on the selected curves.For example there are selected curves that have one unselected between them and other that have 2 or 3. How can I fix that? I think its because there are more than one curves for a specific z value which must defined as one work as I would like to.
Yeah this is that cause me the problem. Index 6, 7 have the same Z value so I want to be selected both as if they were one curve. Is there any way to do that?
You can add the even-height curves into different tree branches (In order to do so 1st find the curves with similar heights , then for the main list store the similar ones into branches ) but as far as Iv’e searched there’s not much tool in grasshopper to do that easily . You could reference your 71 polyline into grasshopper (which is boring enough to death) , or write down a piece of code for it .
But you can also do it by creating sets and using the member index or renaming the paths.
Need to go to work, later if I have time Ill post the native component solution
Hello, I am looking for a way to sort curves based on two data, lengths, and heights. For instance, my sorting list should start with the curves which have the lowest Z value, and then inside of these curves, I want to sort them from the longest to shortest lengths.
Is there any way to this this without writing a code?
Yes! Since no recursion is requiered, this can be done easily in vanilla GH.
Doing that kind of stuff(manipulating datatrees) I personally prefer do it via code, since it’s easier to read/understand for me.