insert error

insert error

Anonymous
Not applicable
306 Views
1 Reply
Message 1 of 2

insert error

Anonymous
Not applicable
Hi,

I'm having a problem with the insert on a batch file conversion.
I have something like this for each file being opened:

.....
if (acDocManager->isApplicationContext())
{
es = acDocManager->appContextOpenDocument((char *)((SOpenDocRetStatus *)pData)->pDocName);

(Acad::ErrorStatus)((SOpenDocRetStatus *)pData)->es = es;

if (es == Acad::eOk)
{
pDoc = acDocManager->curDocument();

...........

acDocManager->lockDocument(pDoc, AcAp::kWrite);
es = db->readDwgFile(stBlockPath);
es = curDb->insert(objId, symbolName.c_str(), db);
delete db;
es = acDocManager->unlockDocument(pDoc);

........

In the curDb->insert I've got eWasOpenForWrite and the block is not inserted in the DWG.

Can anyone help me?
Thanks

David
0 Likes
307 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
David Arouca wrote: > Hi, > > I'm having a problem with the insert on a batch file conversion. > I have something like this for each file being opened: > > .... > if (acDocManager->isApplicationContext()) > { > es = acDocManager->appContextOpenDocument((char *)((SOpenDocRetStatus *)pData)->pDocName); > > (Acad::ErrorStatus)((SOpenDocRetStatus *)pData)->es = es; > > if (es == Acad::eOk) > { > pDoc = acDocManager->curDocument(); > > ........... > > acDocManager->lockDocument(pDoc, AcAp::kWrite); > es = db->readDwgFile(stBlockPath); > es = curDb->insert(objId, symbolName.c_str(), db); > delete db; > es = acDocManager->unlockDocument(pDoc); > > ........ > > In the curDb->insert I've got eWasOpenForWrite and the block is not inserted in the DWG. > > Can anyone help me? > Thanks > > David Make sure you close the block table before you call insert(). -- Best regards, Byron Blattel CADwerx--Applications for AutoCAD Autodesk Registered Developer Contact Info @ http://www.cadwerx.net Custom Programming Services - ObjectARX/C++/MFC/ASP/STL/ATL/ISAPI...
0 Likes