As documented in the Abaqus Scripting Reference Manual, ODB API provides getActiveOdb() method to be used inside an Abaqus/Standard or Abaqus/Explicit user subroutine written in C++. When calling getActiveOdb(), users may find that it works fine during the first call but the subsequent calls to the function fail with an exception. The exception is thrown if more than one ODB is currently open. It should be noted that if your code opens the same ODB more than once, it is treated as multiple ODBs and the same exception is thrown.
A workaround can be to check using a static variable if the getActiveOdb() was used to open the ODB before,
static odb_Odb* myOdb= 0;
if (!myOdb){
myOdb = &getActiveOdb();
}
