Announcements

Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.

Get links in active document

Get links in active document

ottosson_mathias
Advocate Advocate
4,991 Views
3 Replies
Message 1 of 4

Get links in active document

ottosson_mathias
Advocate
Advocate

I want to get all the linked files of the active document. But when I use a FilteredElementCollector with OfClass RevitLinkType I get all opened documents and their linked files! I only want the linked files of the current document. Not the the open document, just links 🙂

 

var links = new FilteredElementCollector(document).OfClass(typeof(RevitLinkType));

 

If not possible, how can I determine if the RevitLinkType in my filteredElementCollector is from the current document?

 

Thanks!

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

jeremytammik
Autodesk
Autodesk
Accepted solution

Does this previous thread answer your question?

 

https://forums.autodesk.com/t5/revit-api-forum/find-revitlinks-is-loaded-or-unloaded/td-p/6819396

 



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

0 Likes
Message 3 of 4

ottosson_mathias
Advocate
Advocate

Thanks Jeremy, it helped med to continue my search where I found this post which did exactly what I needed: https://forums.autodesk.com/t5/revit-api-forum/getlinkdocument-broken-in-2020/m-p/9385210.

 

Is it just me or is it difficult to get good search results on this forum search?

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Thank you for the additional link.

  

I totally agree that it is difficult, and that applies to just about every search engine I know.

  

Typepad is much worse.

  

Google and DuckDuckGo seem to provide decent results.

  

I just implemented my own full-text search, and that is not perfect either, as it stands now: 

  

https://thebuildingcoder.typepad.com/blog/2020/09/optimising-parameters-and-full-text-search.html

  

Maybe you really need a bit of natural language processing (NLP) to be able to achieve really good functionality.

  

And with the speed at which that technology is currently advancing, I think much better results than we are used to should be achievable today without too much effort.

  



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

0 Likes