I have next code.
AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse);
Acad::ErrorStatus res = pDb->readDwgFile(FGridProperty->FHeaderFileName);
if (res != Acad::eOk)
{
acutPrintf("\nRead header file is failed!");
delete pDb;
return;
}
AcGePoint3d Position;
AcDbObjectId IntBlockDefId;
res = pBlockDef->database()->insert(IntBlockDefId,
FGridProperty->FHeaderBlockName, pDb);
delete pDb;
if (res != Acad::eOk)
return;
AcDbBlockReference *pBlockRef = NULL;
pBlockRef = new AcDbBlockReference(Position, IntBlockDefId);
res = pBlockDef->appendAcDbEntity(HeaderBlockRefId, pBlockRef);
pBlockRef->close();//close header block ref
This code work normally under AutoCAD 2004.
But under Mechanical Desktop 2004 arise error on the "appendAcDbEntity"
First-chance exception at 0x77e73887 in acad.exe: Microsoft C++ exception:
Acad::ErrorStatus @ 0x0012eec4.
First-chance exception at 0x77e73887 in acad.exe: 0xE0000001: 0xe0000001.
and in message "External Exception 0000001".
What I do wrong?!
Regards,
Alxd