How to get the Status of the Revit Link?

How to get the Status of the Revit Link?

Anonymous
Not applicable
1,368 Views
2 Replies
Message 1 of 3

How to get the Status of the Revit Link?

Anonymous
Not applicable

Links.PNGBy using the method RevitLinkType.IsLoaded() I can only tell whether or not the link is loaded (True or False). But is there a way to get the Status string?

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

jeremytammik
Autodesk
Autodesk

What strings can possibly be displayed?

 

Just the three in your screen snapshot, or others as well?

 

Have you searched all the members?

 

https://www.revitapidocs.com/2020/4f035f8a-1314-99c2-a05a-f6d5bea0037a.htm

 

Have you checked all properties in RevitLookup?

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous ,

try using the below code

FilteredElementCollector coll = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RvtLinks).WhereElementIsElementType();
                foreach (Element e in coll)
                {
                    ExternalFileReference EX = e.GetExternalFileReference();
                    string linkStatus= EX.GetLinkedFileStatus().ToString();
                }

I hope this helps.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network