Purge Unused Elements and removing unloaded RVT Links




Pretty new to actually using dynamo so apologies if I’m not clear in any responses

i have a script that basically deletes everything from the model other than a 3D View and some typical plan views, the only 2 areas i cant seem to sort are

  • Purge unused Elements
  • Remove unloaded nested Revit links

we are having to do this because the external architect is not willing to clean models when being shared with us so I decided to create a basic script to remove everything other than the geometry itself as that’s all we are interested in.

I can remove cad links ok but not rvt links

we are also adapting it to clean our own models before issuing them to everyone.

so does anyone have an idea on how to add the above

Thanks for your help


Purge Unused Elements?

Hi @paul_witham ,
you can delete them like this:

import clr
from Autodesk.Revit.DB import*

from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

OUT = FilteredElementCollector(doc).OfClass(RevitLinkInstance).ToElements()


Thanks Mostafa that worked i also found another way without using python so now have 2 options

Thanks again


Hi @paul_witham. I saw you got 1 of the 2 items you needed. Have you had any luck with the purging of unused elements? Within Dynamo?


any luck with this?