<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Convert RevitLinkInstance to Element in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/convert-revitlinkinstance-to-element/m-p/10481570#M24683</link>
    <description>&lt;P&gt;I extracted linked walls from a View using a CustomExporter 2D. From the exporter the walls are just seen as Elements:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;public RenderNodeAction OnElementBegin2D(ElementNode node)
{
    Element e = node.Document.GetElement(node.ElementId);
    ...
    return RenderNodeAction.Proceed;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be able to dimension them I need these Elements to be converted to RevitLinkInstances so that I can get the correct reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To convert from a RevitLinkInstance to an Element I did:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;RevitLinkInstance link = e as RevitLinkInstance;
Document linkedDoc = link.GetLinkDocument();
e = linkedDoc.GetElement(r.LinkedElementId);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how do you convert from an Element to a RevitLinkInstance?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 08:13:56 GMT</pubDate>
    <dc:creator>mehdi.blanchard</dc:creator>
    <dc:date>2021-07-20T08:13:56Z</dc:date>
    <item>
      <title>Convert RevitLinkInstance to Element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/convert-revitlinkinstance-to-element/m-p/10481570#M24683</link>
      <description>&lt;P&gt;I extracted linked walls from a View using a CustomExporter 2D. From the exporter the walls are just seen as Elements:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;public RenderNodeAction OnElementBegin2D(ElementNode node)
{
    Element e = node.Document.GetElement(node.ElementId);
    ...
    return RenderNodeAction.Proceed;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be able to dimension them I need these Elements to be converted to RevitLinkInstances so that I can get the correct reference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To convert from a RevitLinkInstance to an Element I did:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;RevitLinkInstance link = e as RevitLinkInstance;
Document linkedDoc = link.GetLinkDocument();
e = linkedDoc.GetElement(r.LinkedElementId);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how do you convert from an Element to a RevitLinkInstance?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 08:13:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/convert-revitlinkinstance-to-element/m-p/10481570#M24683</guid>
      <dc:creator>mehdi.blanchard</dc:creator>
      <dc:date>2021-07-20T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert RevitLinkInstance to Element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/convert-revitlinkinstance-to-element/m-p/10482375#M24684</link>
      <description>&lt;P&gt;I just searched RevitLinkInstance on the SDK (which you can find &lt;STRONG&gt;&lt;A href="https://www.autodesk.com/developer-network/platform-technologies/revit" target="_self"&gt;here&lt;/A&gt;&lt;/STRONG&gt;), and found this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;RevitLinkInstance.Create(document, elementId);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 13:42:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/convert-revitlinkinstance-to-element/m-p/10482375#M24684</guid>
      <dc:creator>AGGilliam</dc:creator>
      <dc:date>2021-07-20T13:42:07Z</dc:date>
    </item>
  </channel>
</rss>

