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.
Retrieve all linked file names from a model.
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)
Move the link to the workset with the same name. (instance and type worksets)
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.
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.