How to retrieve the Status and Reference Type of linked files in the document?

How to retrieve the Status and Reference Type of linked files in the document?

Anonymous
Not applicable
1,018 Views
3 Replies
Message 1 of 4

How to retrieve the Status and Reference Type of linked files in the document?

Anonymous
Not applicable

LinkedDocs.PNGI can get the linked files by using FilteredElementCollector(doc).OfClass(RevitLinkInstance), but is it possible to get the Status and Reference Type?

0 Likes
Accepted solutions (2)
1,019 Views
3 Replies
Replies (3)
Message 2 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous ,

Try using the below code

 FilteredElementCollector Col = new FilteredElementCollector(doc).OfClass(typeof(RevitLinkType));
                foreach(Element e in Col)
                {
                    ExternalFileReference fileRef = e.GetExternalFileReference();
                    //TO GET STATUS 
                    string status =fileRef.GetLinkedFileStatus().ToString();
                    //TO GET REFERENCETYPE
                    string rTYPE = e.get_Parameter(BuiltInParameter.RVT_LINK_REFERENCE_TYPE).AsValueString();                   
                }

If this helped solve your problem please mark it as solution, so other users can get this solutions as wellSmiley Happy


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks a lot!

Do you how to get the names of linked files?

0 Likes
Message 4 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous ,

Yes, you can get the name using

 RevitLinkType RLT = e as RevitLinkType;
string name=RLT.Name;

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes