Purge Unused Elements and removing unloaded RVT Links

Hi

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

Paul

Hi @paul_witham ,
you can delete them like this:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

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

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

Thanks again

5 Likes

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?

Orchid package contains a node that can purge unused down to 0 - game changer!

3 Likes

Hi @GavC, My interface has gone a bit weird and I haven’t got the time to figure out a fix for it now. Can you tell me the name for the purge node? The search function seems to be working, but I’ve never used Orchid before so I’m a bit blind.

1 Like

G’day! I have that issue often as well - it’s caused by DS.Core/Orchid not resolving their design scripts I think. A quick fix for that is to reboot Dynamo/Revit and open a script before you open a ‘new’ script. Typically works.

Anyway to the topic at hand…

Just in case you need to Install Orchid, refer below. If not right to the bottom of the post.

Orchid is a bit of a fun one to install… it runs off DLL’s so needs to be installed outside Dynamo package manager. You can find it here;

You’ll need to install off the Github exe and then install the samples after. Follow his readme and open one of the sample files, which will ‘activate’ Orchid properly. This step is critical - and make sure to install as the local user (not as admin or ‘another user’). See images below.


From here, just search for any of the below…

1 Like