Reindex curve indices according to near standing points indices

reindex curve indicies by.gh (8.2 KB)

Hi, guys! Could please help me with this stuff. I need to rearrange indices of curves to be the same as indices of near standing points. Count of points always the same as the count of curves. The solution should be universal, “not replacing one by one”. Thanks in advance!


reindex curve indicies by_re.gh (11.5 KB)

Graft points > every point will “become a branch”
In each branch you test all the curves, so you get a list of distance, from the main branch point.
Sort to get the closest one, but picking the index of that curve.
Using list to retrieve the original list re-ordered.

Edit: @Joseph_Oster 's solution is way better.

1 Like

missing


reindex_curve_indicies_2019Oct1a.gh (15.8 KB)


reindex_curve_indicies_2019Oct1b.gh (9.1 KB)

3 Likes

You can also use Closest point

reindex curve indicies by2.gh (10.8 KB)

1 Like

Thanks, u guys for ur time!!! I’ve tried all solutions, the best working for my real issue is the solution of Seghier Khaled… I was struggling to solve it almost all night, u r the best!!!