Delete duplicate elements


I have a Revit project with multiple loads. My problem is that my dynamo script for the loads in Revit creates new loads on top of my old everytime i open the Dynamo file.

Examples are loads on columns. I have four columns in my project, so my script creates four line loads on each column. Next time i open dynamo it creates four new line loads, now eight in total. Is there a way i can delete the “duplicates” with dynamo?

Note. My script gives each new line load a new ID because it creates a new line load. Therefore i am not able to use list duplicate items or list unique items. If they newest line loads had the same ID this would not be a problem.

My script filters the line loads in my project by load case (i have multiple load cases).

So far i have two options. One that chop the list of line loads on the columns into sublist with length = 4 (I know that i am only going to have 4 loads). I then delete all the lists exept the first. This works fine, but what if the loads don’t add up to four? So this option is not perfect.

Option two is the one with the unique items, that doesn’t work because of no duplicates.

Is there maybe a way to find elements by location and then delete the “duplicates” or some other way to do this?


Hi, try and have a look here:

1 Like