Remove duplicate instances

hello to everyone,
I am trying to perform a routine to remove duplicate occurrences in REVIT.
I’m not sure of my version but 2.3 I think.
thank you in advance for your feedback
ID-SUPP_DOUBLON.dyn (18.4 KB)

@martial.nouzilleBXLD not sure what you are trying to do with your script, but I guess maybe you want to move a revit link to a certain location based on some XY input?

thank you for your return,
no I try to find the duplicate elements to delete them automatically via the routine

In this case, you can use Point.PruneDuplicates to get the unique points then filter out the additional point/ duplicate using an == operator, List.UniqueItems will work as well, but with Point.PruneDuplicates it is possible to set a tolerance for points proximity, hence duplicates.

If they are indeed duplicates then they will trigger a warning (identical instance in same place). Get the warning related elements, and take the one with the higher (later) Id, then delete those.

warnings.dyn (21.4 KB)

3 Likes

hello to everyone,

First of all thank you for your return and your help.
once duplicate occurrences are identified, then automatically delete them with Dynamo and of course without having to do another routine?
thank you for your feedback

The script i attached both finds and then deletes in one run. Note that it will always delete the later copies, and keep the first one that existed. So it a user has tagged the later ones they will be deleted anyway.

Thank you for this valuable information.
however in base I have 3674 errors of which 24 duplicates and when I run the script it does not reduce the number of error.

again thanks for your help

Missing input on the last node.

I don’t have in my nodes “Element delecte” as shown in which package can I find it?

That one is from Springs.

What I don’t understand is that I can’t bring out the duplicate elements. When I run the script it doesn’t work.

Those elements look weird, theyre using a custom class from archilab. Can you try using Crumple and the script I sent? I can’t speak for other packages so if you use those then it will potentially be a different result.

Hello,
Thank you for your help. It’s working properly, I wasn’t using the right knots. But one last question. We’re sure I’m deleting only duplicate items from my artwork?

Sincerely

Hi @GavinCrump and @martial.nouzilleBXLD
I think remember that warnings doesn’t take in account duplicate system families elements in same place like duct, pipes, etc.
Cheers

Yes it wont capture all element types unfortunately. The only way to truly do it would be to get all elements in a model, their location and their data, then identify all duplicate occurences in that list. Not sure Dynamo would survive such a big transaction though, maybe 1 category at a time…

1 Like

It would delete all but the first element in each warning, so ideally all but one duplicate object remains in each case. Review the results to see if it works as desired. Not sure what the artwork means.

I have a post in here, hope it useful for you
https://chuongmep.com/Check-Element-Duplicate-Dynamo-Revit

Hi @chuongpqvn to try your workflow for system families the node “Point.MidPoint” came from any package?
Thanks

In package Dynamep

2 Likes