Revit API

Reply
Valued Contributor
FRFR1426
Posts: 75
Registered: ‎04-05-2012
Message 1 of 2 (258 Views)
Accepted Solution

Find the RevitTypeLink from the RevitLinkInstance

258 Views, 1 Replies
12-18-2012 08:20 AM

I know I can test if the document title is contained in the name of the LinkInstance like this:

 

linkInstance.Name.Contains(linkedDocument.Title)

 but is there a more direct and safe way?

Ok, I've found it. Simply use GetTypeId:

 

var linkType = (RevitLinkType)document.GetElement(linkInstance.GetTypeId());

 

Valued Contributor
FRFR1426
Posts: 75
Registered: ‎04-05-2012
Message 2 of 2 (244 Views)

Re: Find the RevitTypeLink from the RevitLinkInstance

12-20-2012 03:04 AM in reply to: FRFR1426

Ok, I've found it. Simply use GetTypeId:

 

var linkType = (RevitLinkType)document.GetElement(linkInstance.GetTypeId());

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.