JC_BL
in reply to: JC_BL

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.  That is even before my add-in is loaded.  And also 2019 version of FabricationCore.dll is also loaded.

 

The IExtensionApplication.Initialize() of my 2023 add-in tries to load the correct version of FabricationAPI.dll.  But seem like the fact that 2019 FabricationAPI.dll has already been loaded prevents the 2023 version of FabricationAPI.dll from being loaded.  There is no error message.  The LoadFrom() function shown below simply returns the info about the 2019 FabricationAPI.dll in the Assembly object:

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
      {
      }
   }

 

But the add-in is built for 2023 Fabrication API.  This "may" have caused the add-in to fail whenever it needs to talk to Fabrication API.

 

So, the question is "Why CADmep 2023 pre-loads the 2019 FabricationAPI.dll?".  Any idea?

 

Thanks in advance.

 

JC_BL