Remove a specific link from a model

I’m looking to remove a specific link from a model after running a script. eg a linked in model with the word “Example” in its file name.

I can do similar with sheets using a delete element node. Replaced the category with RVT links but after running, it didn’t remove the link. Wondering if the dynamo gurus can advise if there is a better approach?

Some context - Our company template has an Example Model, linked into it. This is used on Example sheets to show new inexperienced users how to set up sheets and how things should look. I’m planning to make a script so experienced users that know what they are doing can quickly remove the example sheets, the views on them, and the linked revit file to help tidy up the model if its info they don’t need.

Hi @Mountain does it work if you delete the linktype…

Just tried your option 2 node. I think its my filter thats messing things up (see image). when I pin the node the filters saying “Empty List”. But prior to the filter the all elements of category says there’s only 1 link. but as you an see in the image there’s 2. My filter is also returning “Empty List” so assuming i need to get the element name out of my All Elements of Category, then filter by the name. Couldn’t find a node that would work with giving me my link names though.

1 Like

Arhh ok…is something here better ? the reason for you issue is you probably have deleted the instance link but not the type…

yes that was the trick! Thank you :slight_smile: . Yeah the first run deleted it from the model but it still appeared in the link manager and the project browser. Your way got rid of it from all. Didn’t think revit treated links like types like types.

Working script below should anyone else want to attempt similar in the future and they stumble on this during searches.

2 Likes

Yes thats how it works :wink: even when we do it manuelly we have option that…nice it could work :wink:

Capture