Revit API

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

Find the RevitTypeLink from the RevitLinkInstance

263 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: 87
Registered: ‎04-05-2012
Message 2 of 2 (249 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());

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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