Remove duplicate points from a combined/ structured list

Hello all,

I want to filter my combined list on duplicate points, but the problem now is that my combined list structure (in the List.Combine command) is gone. Is there a way to keep this structure but still remove the duplicate points?

Thanks in advance!

1 Like

Hey thank you for the fast reply, but this is not the solution i am looking for. I need to filter all the duplicate results. not per list

In your example i would have 1 list with 1 to 8 and the other one would be empty (because you have the same code block twice)

This is a tough one.

As a start, take your PruneDuplicates node and get the first index of each item in each sublist with a List.AllIndicesOf node and some crossproduct lacing at level 2 and keeping the list structure. The next steps should start to unravel from there.

1 Like

@Daan This might work…
removeDuplicatePoints.dyn (17.7 KB)

5 Likes

Using something like List.FirstItem might not work well for points with FP coordinates. You could try something along the lines of this in those cases:

2 Likes

Python would make this a lot easier. For each item check to see if it’s in a list of UsedItems. If it is, ignore it. If it’s not, append it to the list and then add it to UsedItems.

1 Like

Vikram thank you so much!!! this solved my problem perfectly !!

2 Likes

Thank you for this solution, the fix of Vikram works for me but maybe i’ll use your solution if it fails to work!!!

1 Like

Hey Venkov thank you for this solution, i figured that the solution of Vikram has no room for a “too close to” input, with your script i can just add 0.5 meters for that as tolerance for the Point.PruneDuplicates node!

Again, thank you!!

1 Like

Hey Dimitar i dont get the same results when using the exact same script as you wrote, do you maybe know what i did wrong?

Thanks in advance!

You’ll need to set the lacing of a few of the nodes to longest. Here’s the graph for reference:

PruneNested.dyn (24.4 KB)