ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with block insertion.

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
161 Views, 2 Replies

Problem with block insertion.

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
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

I also have the same problem...works fine with Acad2004 but crash on Acad Mechanical 2004 ...it crash at

pblockrecord->appendAcDbEntity..... I haven't found the solution yet... I believe it got to do with database locking problems...

Henry
Message 3 of 3
Anonymous
in reply to: Anonymous

Hi, Alxd!
Try AutoCAD Mechanical 2004 Service Pack 1
(http://usa.autodesk.com/getdoc/id=DL404062)

Best Regards,
Alexander Rivilis

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost