<?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: How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC? in Fabrication CADmep Forum</title>
    <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11787710#M5212</link>
    <description>&lt;P&gt;If someone knows why fixing the version number in PackageContents.xml in the other add-in can fix the problem in CADmep 2021, 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:51:41 GMT</pubDate>
    <dc:creator>JC_BL</dc:creator>
    <dc:date>2023-02-28T14:51:41Z</dc:date>
    <item>
      <title>How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11776275#M5204</link>
      <description>&lt;P&gt;I have developed a set of add-ins in CADmep 2019 (Fabrication 2019 API).&amp;nbsp; They work fine.&amp;nbsp; But CADmep 2019 is getting old. We are thinking of switching to CADmep 2023.&amp;nbsp; During the transition period, we need to have both CADmep 2019 and 2023 to co-exist for quite a long while.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have fixed the incompatible data types in the source code to have it compiled correctly in both CADmep 2019 and 2023 (using Conditional Compiling Symbols).&amp;nbsp; But my program always fails in CADmep 2023 as soon as it needs to use any object/function related to Fabrication API, such as Job.Items, Database.CustomItemData, Job.GetFabricationItemFromACADHandle().&amp;nbsp; The program still works fine in CADmep 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has nothing to do with AutoCAD API, they work fine.&amp;nbsp; The problem has to do with Fabrication API -- specifically related to the version of Fabrication API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have traced the problem to the possibility that both versions of my program "seem" to use Fabrication 2019 API regardless it is running in CADmep 2019 or 2023.&amp;nbsp; This explains why the program works fine in CADmep 2019, but not in 2023.&amp;nbsp; This is odd because I have purposefully built a version of my program for each CADmep -- one for CADmep 2019 and another one for 2023.&amp;nbsp; And I know for a fact that I am using the 2023 version of my program (because I have added a special command called "JayTest2023" in the 2023 version of my program that is not available in the 2019 version of my program).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can work around this problem by renaming the Fabrication 2019 folder from this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;C:\Program Files\Autodesk\Fabrication 2019&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Into something like this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;BR /&gt;C:\Program Files\Autodesk\Temp_Disabled_Fabrication 2019&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;After I have renamed that folder, seems like this "forces" CADmep 2023 not to use Fabrication 2019 API.&amp;nbsp; And all the suddenly, everything works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously this is not a good solution because this prevents someone from using CADmep 2019 and 2023 in the same computer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any suggestion that I can try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, my add-ins are deployed through PackageContents.xml in C:\ProgramData\Autodesk\ApplicationPlugins\MyCadLib.bundle folder.&amp;nbsp; Not sure if this matters or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you need some sample source code to look at, please let me know and I will prepare it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JC_BL&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 15:07:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11776275#M5204</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-23T15:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11779611#M5208</link>
      <description>&lt;P&gt;I dig into this issue a bit using Resource Monitor to see which version of FabricationAPI.dll is being loaded, and I find that the 2019 version of FabricationAPI.dll is loaded whenever CADmep 2023 is loaded.&amp;nbsp; That is even before my add-in is loaded.&amp;nbsp; And also 2019 version of FabricationCore.dll is also loaded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;IExtensionApplication.Initialize() of my 2023 add-in tries to load the correct version of FabricationAPI.dll.&amp;nbsp; But seem like the fact that 2019 FabricationAPI.dll has already been loaded prevents the 2023 version of FabricationAPI.dll from being loaded.&amp;nbsp; There is no error message.&amp;nbsp; The LoadFrom() function shown below simply returns the info about the 2019 FabricationAPI.dll in the Assembly object:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;void IExtensionApplication.Initialize()
   {
   try
      {
      String sFullPathFabApiDllFileForCAD = "C:\\Program Files\\Autodesk\\Fabrication 2023\\CADmep\\FabricationAPI.dll";
      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;But the add-in is built for 2023 Fabrication API.&amp;nbsp; This "may" have caused the add-in to fail whenever it needs to talk to Fabrication API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, the question is "Why CADmep 2023 pre-loads the 2019 FabricationAPI.dll?".&amp;nbsp; Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in&amp;nbsp;advance.&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:51:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11779611#M5208</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-24T18:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11787674#M5210</link>
      <description>&lt;P&gt;This problem is fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The cause of the problem has to do with the PackageContents.xml of a _different_ add-in in my computer contains an "inappropriate" version number.&amp;nbsp; It was like this in that PackageContents.xml file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;RuntimeRequirements ... SeriesMin="R19" /&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R19 is for AutoCAD version 2013 to 2014.&amp;nbsp; My computer doesn't have that version of AutoCAD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That add-in also needs to use Fabrication API.&amp;nbsp; I had been focusing on the add-in that I am working on, and I didn't realize that the problem was coming from a different add-in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that wrong version number in PackageContents.xml in that add-in, when I launched CADmep, seem like CADmep chose to launch the oldest version of FabricationAPI.dll in my computer and that happens to be version 2019.&amp;nbsp; This explains the reason why the 2019 version of FabricationAPI.dll has been pre-loaded when I launch CADmep 2023.&amp;nbsp; And that somehow prevents my program from loading 2023 version of&amp;nbsp;FabricationAPI.dll.&amp;nbsp; This explains the reason why I had a problem loading 2023 version of&amp;nbsp;FabricationAPI.dll in CADmep&amp;nbsp;2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the reason why I cannot get CADmep 2021 to load "any" version of&amp;nbsp;FabricationAPI.dll, I still don't know.&amp;nbsp; Nevertheless, the problem in CADmep 2021 is also fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fix is to enter the correct version of AutoCAD in PackageContents.xml in that add-in, like this:&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;&amp;lt;RuntimeRequirements ... SeriesMin="R23" SeriesMax="R23"/&amp;gt;&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R23 is the version number for AutoCAD 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I find that CADmep can pre-load the correct version of FabricationAPI.dll or CADmep can allow my add-in to load the correct version of FabricationAPI.dll.&amp;nbsp; And the add-in works properly in multiple versions of CADmep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps someone.&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 21:02:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11787674#M5210</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-28T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Have Fabrication 2019 and Fabrication 2023 Co-Exist in the Same PC?</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11787710#M5212</link>
      <description>&lt;P&gt;If someone knows why fixing the version number in PackageContents.xml in the other add-in can fix the problem in CADmep 2021, 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:51:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/how-to-have-fabrication-2019-and-fabrication-2023-co-exist-in/m-p/11787710#M5212</guid>
      <dc:creator>JC_BL</dc:creator>
      <dc:date>2023-02-28T14:51:41Z</dc:date>
    </item>
  </channel>
</rss>

