MLightCAD
    Preparing search index...
    • Runs work against a secondary (non-document) database while temporarily making it the host application working database.

      Detached object construction historically fell back to workingDatabase.generateHandle(). When the host document is recording an undo transaction (e.g. during XATTACH), that minted non-TEMP handles owned by the host and caused assertOpenForWrite failures while converting the secondary file. Switching workingDatabase for the duration of the secondary read keeps symbol-table import mutations against the correct database.

      Always restores the previous working database, even when fn throws.

      Type Parameters

      • T

      Parameters

      • secondaryDb: AcDbDatabase
      • fn: () => T | Promise<T>

      Returns Promise<T>