Hi Everyone,

I have (2) lists of curves. I want to match sort order of List B to List A.

Thanks for any help in advance!!!

Mitesh

Hi Everyone,

I have (2) lists of curves. I want to match sort order of List B to List A.

Thanks for any help in advance!!!

Mitesh

1 Like

So you have an unsorted list A, a sorted list A, and you want to switch elements in the unsorted list B so that they match the sorted list A ?

If List B are the same elements as List A but in the wrong order, yet List A is the right order, why not just use List A? Otherwise, can you explain how you want it sorted?

You can sort your list with IndexOf and List.GetItemAtIndex.

1 Like

So Basically List B is well organized for Point X and Y and not Z. However, List A is having correct Point Z values

Basically, Idea is to sort the list first then replace corrected Point Z values.

Thanks,

Mitesh

So just you know, Point Z value is not going to be constant.

From what i get, you just want to replace the Z coordinates in the B list by the Z coordinates in the A list. Is that correct ?

If not, could you write your own example with like, say, 5 points in both lists ?

I want to replace Z values from List A to List B. But My List A is not sorted out for X and Y.

Then just deconstruct the points by their coordinates, and reorder as we showed you, then recreate the points.

Iâ€™ll post it here when iâ€™m done.

I suppose for sorting by X *and* Y, extra steps may be required but essentially this.

Here it is. Re-ordering list B so the X and Y coordinates match those of list A. It is just an application of what Alban posted earlier, on a more elaborate example.

home.dyn (25.1 KB)

3 Likes

Can you please let me know that package name of â€śList.IndexOfâ€ť node?

I canâ€™t seem to find one in my packages

Thanks,

Mitesh

Itâ€™s an Out of the Box node. Available as you install Dynamo. Iâ€™m using 2.0, but i think it is available in 1.3 also.

I am using 1.3.2 but didnâ€™t fine one. Also, Your DYN file seems corrupted or may be because of its created in higher version i guess.

It also exists in 0.9 so you really should have it somewhereâ€¦ Nothing comes up if you type â€śindexofâ€ť into the search field?

Else you may want to reinstall Dynamo.

Thank you everyone!!

You suggestions worked really very wellâ€¦

I have marked this post as solved

Mitesh

I have a same problem but my list have some point have same X or Y, can you give me a advice?