Finding Duplicates in a List


I’m hoping someone can help point me in the right direction. I’ve been banging my head for a while trying to accomplish what I thought would be a simple task - flagging duplicate Door Numbers in a Revit model. Thus, I’m looking for a simple strategy to isolate a list of duplicates from a longer list containing duplicates. (Basically the inverse of “List.UniqueItems”). The custom node “Duplicate Item Indices” seemed to hold promise - but I can’t get it to return anything (see attached). It seems like I should be able to use “List.UniqueItems” to create a culled list and somehow compare that to the original list so as to return only the duplicated items, but so far the logic has escaped me.









Apologies ahead of time if this is a common issue and has already been addressed.



Hmm, mine is working. Dynamo 0.8.1 with run automatically.



Hi Bill, you could try something along the lines of this:



John, I tried it again 0.8.1 (Automatic & Manual) returned Nulls both ways - can someone explain the disconnect? I believe I downloaded the Node this week



Thanks for the input - I certainly have a ways to go in wrapping my head around this type of logic …


You could also try List.AllIndicesOf

File: Duplicates.dyn