Find the RevitTypeLink from the RevitLinkInstance

Find the RevitTypeLink from the RevitLinkInstance

FRFR1426
Collaborator Collaborator
632 Views
1 Reply
Message 1 of 2

Find the RevitTypeLink from the RevitLinkInstance

FRFR1426
Collaborator
Collaborator

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?

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Accepted solutions (1)
633 Views
1 Reply
Reply (1)
Message 2 of 2

FRFR1426
Collaborator
Collaborator
Accepted solution

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

 

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

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes