Thank you for quick response,
In case I change LoadModelById() call to LoadRootModelById() I got this very excpetion during this call to LoadRootModelById(). I guess, ReadAndLoadDgnAttachments() is called inside LoadRootModelById().
Here is OpenFile method:
RefCountedPtr<DgnFile> DgnInfoLib::FileHelper::OpenFile(std::wstring path) { DgnOpenStatus status; RefCountedPtr<DgnFile> file = nullptr; // Create document auto document = DgnDocument::CreateFromFileName(status, path.c_str(), nullptr, DEFDGNFILE_ID, DgnDocument::FETCH_Read, DgnDocument::FETCH_OPTION_Default); if (document != nullptr) { // create File and load it's header file = DgnFile::Create(*document, DGNFILE_OPENMODE_READONLY, *DgnInfoLib::Utils::StaticHostHelper::host); auto ret = file->LoadDgnFile(NULL); } return file; }
Thank you in advance,
Artem