Revit API

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

Find the RevitTypeLink from the RevitLinkInstance

270 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: 92
Registered: ‎04-05-2012
Message 2 of 2 (256 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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!