Curve length branch


(Fereshteh Khojasteh) #1

hello, i have a problem for sorting my curves,
i have a list of curves with different lengths and i want to sort them by their length so that curves with the same length go to a specific group,

is anyone here help me by that?
here is the definition


curve length sort.gh (94.7 KB)


(Matt Gaydon) #2

Just use C Set, Member Index and Item like so. Also you can use Round (x,2) in the expression instead of format if that’s easier to read.

Sort Curve Lengths - Groups.gh (103.9 KB)


(Fereshteh Khojasteh) #3

Thanks a lot, it was really helpful
and can you please guide me how to select from them?
i mean how should i select curves with length for example 0.36?


(Aris Nikolopoulos) #4

Hi,
I’m almost sure it’s not the optimal solution but it works (I’m answering because nobody has answered so far)

Sort Curve Lengths - Groups.gh (99.2 KB)


(Matt Gaydon) #6

One way is to replace the CSet with a slider or a panel this, will only find the ones with the number and not sort all the others mind.

If you need it after the grouping just do it like this.

Updated Code attached (Now Matches Pictures :grinning:
curve length sort Update.gh (98.8 KB)


(Fereshteh Khojasteh) #7

thank you


(Fereshteh Khojasteh) #8

Thanks dear Matt but its not the updated file, can you please attach it again?


(Matt Gaydon) #9

Ah sorry, Seems not to have saved before uploading. Updated code above and also attached here. curve length sort Update.gh (98.8 KB)


(Fereshteh Khojasteh) #10

Thanks for your kindness :slight_smile: