Is it possible to retrieve the names of all linked files (Revit and CAD)

Is it possible to retrieve the names of all linked files (Revit and CAD) from a Revit model?


What I am looking for is the following.


  1. Retrieve all linked file names from a model.
  2. Create workset with the same name as the linked files, by appending $LR_, if it is a Revit link and $LC_, if it is a CAD link. (Eg $LR_Filename.rvt or $LC_Filename.dwg)
  3. Move the link to the workset with the same name. (instance and type worksets)

It’s definitely possible! I’m not at a CPU right now, but I can whip something up when I go into work in the AM. (~8 hrs from now)

Exactly what I was looking for Chris.

Thank you John for volunteering.

It was a bit more involved, but that is a good thing! :slight_smile:


Here’s the node that I now have for you, available in Ayuda. (Get it in the package manager)






Here is is in action (the null value is for if you have a CAD file linked directly on a sheet view, this workset is not editable at all)








And here are the custom nodes “innards”.


Thank you we will give it a go and see how we get on… Thank you.

Hi, I installed Ayuda but can not find the node you are using?

Sorry about that. I had issues uploading it. It should be on there as of the latest update. Let me know if it’s not

Thank you guys, it works perfectly except for one small thing.

In the Type Properties, the linked file is still in the old workset.

Is there any way to get in running in Revit 2014?




Hi John, thank you for the support.

Is it possible to change the workset in the Type Properties too?

This does not work in Revit 2014, even though it does not show any errors.



Creating worksets was only added to the API in Revit 2015 R2. (Mid year update for subscription customers) for the type property, I will have to look at it. It could be as simple as tying an element.type from the link but I am not too sure. As far as I know the instance one is the most important though? Unless you are placing multiple instances of the link.

Thank you John.

Yes, we are placing multiple instances of the link.

Hi Robert,

Yes, It is possible to change workset in type properties you need to feed integer values to your “Workset” parameter. Because Parameter storage type is integer. See below graph. Good Luck!


I just noticed that if there are more than one instance of the same link, it does not move any links to the worksets, although the worksets are created.