Community
You need to lock the document.
Document doc = Application.DocumentManager.MdiActiveDocument;
using (doc.LockDocument())
{
using (Database db = new Database(false, false))
{
db.ReadDwgFile(filePath, FileOpenMode.OpenForReadAndWriteNoShare, true, null);