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


#1

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)

#2

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)


#3

Exactly what I was looking for Chris.

Thank you John for volunteering.


#4

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)

2015-10-01_09h42_34

 

 

 

 

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)

WorksetByLink

 

 

 

 

 

 

And here are the custom nodes “innards”.

2015-10-01_09h44_05


#5

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


#6

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


#7

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 sixtysecondrevit@gmail.com


#8

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?


#9

WorkSets_From_Linked_Files

 

 

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.

 

 


#10

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.


#11

Thank you John.

Yes, we are placing multiple instances of the link.


#12

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!

Untitled5


#13

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.