<?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 Re: Loaded Assembly Code File and Load another file in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/loaded-assembly-code-file-and-load-another-file/m-p/12083584#M10933</link>
    <description>&lt;P&gt;I searched the internet for over an hour to find a solution, searched the Revit Api Forum also of course, but did not found a solution. So I posted this question here!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought, I will give it one more internet search and found the solution, I will share it here for you all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim p As ModelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath("C:\tabel1.txt")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim s = ExternalResourceReference.CreateLocalResource(MyDoc, ExternalResourceTypes.BuiltInExternalResourceTypes.AssemblyCodeTable, p, PathType.Absolute)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim MyKeyBasedTreeEntriesLoadResults As New KeyBasedTreeEntriesLoadResult&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;MyAssemblyCodeTable.LoadFrom(s, MyKeyBasedTreeEntriesLoadResults)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck with this in case you need it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 13:29:30 GMT</pubDate>
    <dc:creator>c_hanschen</dc:creator>
    <dc:date>2023-07-06T13:29:30Z</dc:date>
    <item>
      <title>Loaded Assembly Code File and Load another file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loaded-assembly-code-file-and-load-another-file/m-p/12083499#M10932</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a nice post for reading All Assembly Codes, Key and Description:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-get-all-assembly-codes-and-descriptions/m-p/10923471" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/how-to-get-all-assembly-codes-and-descriptions/m-p/10923471&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives the basic information for accessing the&amp;nbsp;AssemblyCodeTable.&lt;/P&gt;&lt;P&gt;With the help of RevitLookup I found a way to read the FileName of the loaded Assembly Code File:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim MyAssemblyCodeTable As AssemblyCodeTable = AssemblyCodeTable.GetAssemblyCodeTable(MyDoc)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim MyExternalResourceReference As ExternalResourceReference = MyAssemblyCodeTable.GetExternalResourceReference(ExternalResourceTypes.BuiltInExternalResourceTypes.AssemblyCodeTable)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim FilePath As String = MyExternalResourceReference.InSessionPath&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works for me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can I change the Assembly Code File with the Revit API? In case I want to load another file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris Hanschen&lt;/P&gt;&lt;P&gt;LKSVDD architecten&lt;/P&gt;&lt;P&gt;The Netherlands&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 12:23:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loaded-assembly-code-file-and-load-another-file/m-p/12083499#M10932</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2023-07-06T12:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Loaded Assembly Code File and Load another file</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/loaded-assembly-code-file-and-load-another-file/m-p/12083584#M10933</link>
      <description>&lt;P&gt;I searched the internet for over an hour to find a solution, searched the Revit Api Forum also of course, but did not found a solution. So I posted this question here!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought, I will give it one more internet search and found the solution, I will share it here for you all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim p As ModelPath = ModelPathUtils.ConvertUserVisiblePathToModelPath("C:\tabel1.txt")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim s = ExternalResourceReference.CreateLocalResource(MyDoc, ExternalResourceTypes.BuiltInExternalResourceTypes.AssemblyCodeTable, p, PathType.Absolute)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Dim MyKeyBasedTreeEntriesLoadResults As New KeyBasedTreeEntriesLoadResult&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;MyAssemblyCodeTable.LoadFrom(s, MyKeyBasedTreeEntriesLoadResults)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck with this in case you need it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 13:29:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/loaded-assembly-code-file-and-load-another-file/m-p/12083584#M10933</guid>
      <dc:creator>c_hanschen</dc:creator>
      <dc:date>2023-07-06T13:29:30Z</dc:date>
    </item>
  </channel>
</rss>

