Identifying and Removing Duplicate Lines in a List

Hi everyone,

I’d like to filter out duplicate lines from a list along with their counterparts. I’ve managed to extract one member of each pair, effectively eliminating the duplication. Now, I also want to remove the other member of the pair from the list of lines. To achieve this, I intend to find the indices of the duplicate lines in the original list based on the list of duplicates, but I’m getting ‘-1’ for everything. What could be the solution to this problem?

List.SetDifference also didn’t work. It didn’t take out any elements, but I can see both two are the same(start.p, end.p, vector, length).

Hi,
I can’t understand your objective well. Could you share the Dynamo file?
Have you tried using List.UniqueItems?

Building.dyn (104.4 KB)
fh_alap.dwg (747.8 KB)
REVIT_ép.rvt (5.4 MB)

List.UniqueItems output the same list as the original.

Like this?

1 Like

Geometry objects don’t compare well as there are inherent rounding issues. You’ll want to convert them to something comparable (like a string) in order to check for matching indices.

Or this:

3 Likes