Removing duplicate families from project

Dear all,
Would someone have a dynamo script to remove duplicate families (two identical families in the exact same location) from a project?
Basically, I would like Dynamo to solve all the “duplicate family warnings” automatically.
Would that be possible?
Kind regards, Vincent

I believe Archi-Lab has nodes to get all warnings in a project.
With that you can get the pair(s) of all element IDs in each group of duplicates. Use a select by ID node to accomplish this.
Once done you can grab the second elements and delete them.

Personally I do this manually in the project to ensure nothing was being lost, as I have seen users put parameter data into duplicate #2 and different data into duplicate number #3, creating a ‘which one do we keep’ situation that requires manual review of some sort, and even instances being duplicated but not where a different version of the family was atop the other. You can set up a schedule grouping by a parameter containing the XYZ values of each location as a string (easy to assign to elemetns in a schedule view) to simplify this - in fact when done you can actually delete elements in the schedule view directly when desired.

2 Likes

+1 to this.

Had to sort out a model with heaps of these the other day and my workflow was to:

  1. Get the warnings
  2. Get their elements
  3. Use deconstruct at levels to break the oldest/newer elements out
  4. Use Python to mine all the parameter values until one was found, starting from oldest to newest. This meant if values had been added to newer versions, they’d go back to existing anyway
  5. Filter out any elements with tags, isolate them in view for manual check/tag rehosting
  6. Delete the rest of the newer items, keep the oldest one under assumption it was the intended one

It can be challenging for elements that belong in other elements such as curtain wall mullions, nested families etc. If I had the choice I’d have just had the users manually check vs. automate. Rubbing people’s noses in their own mess is usually the most efficient way to avoid them making another one.

3 Likes