AcDbDatabase *pDb = new AcDbDatabase(Adesk::kFalse); es = pDb->readDwgFile(szDwgFile); if (es == Acad::eOk) { UnlockAllLayer(pDb); pDb->getSymbolTable(pBlkTbl,AcDb::kForRead); pBlkTbl->getAt(ACDB_MODEL_SPACE,pBlkTblRcd,AcDb::kForWrite); pBlkTbl->close(); pBlkTblRcd->newIterator(pBlkTblRcdItr); for (pBlkTblRcdItr->start();!pBlkTblRcdItr->done();pBlkTblRcdItr->step()) { es = pBlkTblRcdItr->getEntity(pEnt,AcDb::kForWrite); if (es != Acad.ErrorStatus::eOk) continue; pRb = pEnt->xData("SOUTH"); if (pRb == NULL) continue; while ((rchain = pRb->rbnext)) { if (rchain->restype == 1000) { strcpy(szVal,rchain->resval.rstring); strcpy(rchain->resval.rstring, "test"); break; } } es = pEnt->upgradeOpen(); es = pEnt->setXData(pRb); es = pEnt->close(); acutRelRb(pRb); } } es = pDb->saveAs("D:\\3.DWG");//(LPTSTR)(LPCTSTR)szCurFilePath//保存出现错误 错误为:文件写入/读出出错 |