<?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: CADmep 2021 - A procedure imported by 'FabricationAPI.dll' could not be loaded in Fabrication CADmep Forum</title>
    <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11787700#M5211</link>
    <description>&lt;P&gt;The problem is fixed.&amp;nbsp; I mentioned the fix in another message thread called "How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?" in this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite the fact that I have fixed the problem, I don't know why the "fix" can prevent this problem from happening and why the problem happened in the first place.&amp;nbsp; Therefore, I cannot call this issue as fixed.&amp;nbsp; If someone knows why, please let me know.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JC_BL&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 14:52:05 GMT</pubDate>
    <dc:creator>JC_BL</dc:creator>
    <dc:date>2023-02-28T14:52:05Z</dc:date>
    <item>
      <title>CADmep 2021 - A procedure imported by 'FabricationAPI.dll' could not be loaded</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11779563#M5207</link>
      <description>&lt;P&gt;I keep getting the error message "System.IO.FileLoadException: A procedure imported by 'FabricationAPI.dll' could not be loaded." when I try to run the add-in that I have written in CADmep 2021.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The add-in runs fine in CADmep 2019 for many years.&amp;nbsp; I am trying to create a version for CADmep 2023.&amp;nbsp; It loads OK in CADmep 2023.&amp;nbsp; But it fails whenever it needs to get access to anything related to Fabrication API.&amp;nbsp; Because I am not making any headway with running my add-in in CADmep 2023, I want to try my luck with CADmep 2021.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately the add-in behaves even worse in CADmep 2021.&amp;nbsp; In the&amp;nbsp;IExtensionApplication.Initialize() of my add-in, I ask it to explicitly load the correct version of FabricationAPI.dll&amp;nbsp; -- that is the one in C:\Program Files\Autodesk\Fabrication 2021\CADmep folder.&amp;nbsp; But I immediately get the error "A procedure imported by 'FabricationAPI.dll' could not be loaded" when CADmep is starting up.&amp;nbsp; The following is the&amp;nbsp;IExtensionApplication.Initialize() that tries to explicitly load FabricatonAPI.dll:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;void IExtensionApplication.Initialize()
   {
   try
      {
      String sFullPathFabApiDllFileForCAD = "C:\\Program Files\\Autodesk\\Fabrication 2021\\CADmep\\FabricationAPI.dll";
         // Of course the folder name is changed for 2019/2021/2023.
      Assembly oAsm = System.Reflection.Assembly.LoadFrom( sFullPathFabApiDllFileForCAD );
      if ( oAsm == null )
         {
         MessageBox.Show( "Fail to load FabricationAPI.dll",
                          "MyAddin", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
         }
      }
   catch( System.Exception ex )
      {
      Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
      Editor   ed  = doc.Editor;
      ed.WriteMessage( "\n" + ex.Message );
      return;
      }
   finally
      {
      }
   }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I notice that the commands exposed from my add-in are not available.&amp;nbsp; Use NETLOAD to manually load my add-in seemingly helps because the commands exposed from my add-in start showing up.&amp;nbsp; Unfortunately I encounter the same error when I try to run any command exposed from my add-in.&amp;nbsp; Seem like FabricationAPI.dll is not loaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also try commenting out the code that tries to explicitly load FabricationAPI.dll, and let CADmep to implicitly load FabricationAPI.dll.&amp;nbsp; This avoids the error during starting up of CADmep.&amp;nbsp; And I also notice that the commands exposed from my add-in start showing up.&amp;nbsp; But I encounter the exact same error when I try to run any command exposed from my add-in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried Dependency-Walker to examine 2021 FabricationAPI.dll, and I see a long list of errors.&amp;nbsp; But I also see the same long list of errors when I examine 2019 FabricationAPI.dll (and my add-in works fine in 2019 Fabrication API).&amp;nbsp; Therefore, I don't know if those errors are relevant or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have checked using Resource Monitor and found that FabricationAPI.dll indeed was not loaded with CADmep 2021.&amp;nbsp; Only FabricationCore.dll (2021 version) is loaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please let me know what else that I should try?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JC_BL&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 18:29:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11779563#M5207</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-24T18:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: CADmep 2021 - A procedure imported by 'FabricationAPI.dll' could not be loaded</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11779740#M5209</link>
      <description>&lt;P&gt;So, my questions are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why CADmep 2021 cannot preload 2021 version of FabricationAPI.dll automatically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why my add-in cannot explicitly load any version of FabricationAPI.dll (2019/2021/2023) in CADmep 2021?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JC_BL&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 20:11:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11779740#M5209</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-24T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: CADmep 2021 - A procedure imported by 'FabricationAPI.dll' could not be loaded</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11787700#M5211</link>
      <description>&lt;P&gt;The problem is fixed.&amp;nbsp; I mentioned the fix in another message thread called "How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?" in this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite the fact that I have fixed the problem, I don't know why the "fix" can prevent this problem from happening and why the problem happened in the first place.&amp;nbsp; Therefore, I cannot call this issue as fixed.&amp;nbsp; If someone knows why, please let me know.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JC_BL&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 14:52:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/cadmep-2021-a-procedure-imported-by-fabricationapi-dll-could-not/m-p/11787700#M5211</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-28T14:52:05Z</dc:date>
    </item>
  </channel>
</rss>

