Message 1 of 2
Convert RevitLinkInstance to Element
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I extracted linked walls from a View using a CustomExporter 2D. From the exporter the walls are just seen as Elements:
public RenderNodeAction OnElementBegin2D(ElementNode node)
{
Element e = node.Document.GetElement(node.ElementId);
...
return RenderNodeAction.Proceed;
}
To be able to dimension them I need these Elements to be converted to RevitLinkInstances so that I can get the correct reference.
To convert from a RevitLinkInstance to an Element I did:
RevitLinkInstance link = e as RevitLinkInstance;
Document linkedDoc = link.GetLinkDocument();
e = linkedDoc.GetElement(r.LinkedElementId);
But how do you convert from an Element to a RevitLinkInstance?
Thanks!