|
用下列代码可以成功插入一个ydphb.dwg图,可是关闭图纸的时候就出错。请问什么原因,谢谢
AcGeMatrix3d mat;
mat.setToIdentity();
mat.setToTranslation(AcGeVector3d(inPoint[X],inPoint[Y],inPoint[Z]));
AcDbDatabase *pNewDb=new AcDbDatabase(Adesk::kFalse);
CString sFileName;
acedFindFile("ydphb.dwg",sFileName.GetBuffer());
sFileName.ReleaseBuffer();
es=pNewDb->readDwgFile(sFileName, _SH_DENYWR,false);
if (es!=Acad::eOk)
{
acutPrintf("\nThe file %s cannot be opend!\n",sFileName);
CompleteEditorCommand();
acDocManager->unlockDocument(curDoc());
return;
}
AcDbDatabase *pDb;
pDb =acdbHostApplicationServices ()->workingDatabase () ;
pDb->insert(mat, pNewDb);
|
|