readfromfile()
{
AcDbDatabase *pDb=new AcDbDatabase(); Acad::ErrorStatus es=pDb->readDwgFile ("e:\\3.dwg"); if(es!=Acad::eOk) { acutPrintf("Fail load dwg file.code:1"); return; } AcDbBlockTable *pBlockTable; es=pDb->getBlockTable (pBlockTable,AcDb::kForWrite ); if(es!=Acad::eOk) { acutPrintf("Fail load AcDbBlockTable.code:2"); return; } AcDbBlockTableRecord *pBlockTableRecord; AcDbObjectId Id; es=pBlockTable->getAt ("10",pBlockTableRecord,AcDb::kForRead ); if(es!=Acad::eOk) { acutPrintf("Fail found special block!.code:3"); return; } else { acutPrintf("Sucessfully find the block!\n"); AcDbBlockTableRecordIterator* pBTRIterator; es=pBlockTableRecord->newIterator (pBTRIterator); if(es!=Acad::eOk ) { acutPrintf("Fail to construct BlockTableRecord Iterator.code:4"); return; } else { int No=0; for(pBTRIterator->start ();!pBTRIterator->done ();pBTRIterator->step ()) { AcDbEntity *pEnt; int ReadOrWrite=1; es=pBTRIterator->getEntity(pEnt,AcDb::kForWrite ); if(es!=Acad::eOk) { acutPrintf("Fail to find the Entity in No:%i,.code:5",No); return; } else { if(ReadOrWrite==1) { acutPrintf("And it is opened for write!\n"); // 如果当前实体是以AcDb::kForWrite方式打开的,则要这样做 pEnt->downgradeOpen(); pEnt->draw(); } No++; }//if }//for acutPrintf("The Record contain %i blocks!",No); // 刷新显示屏幕 actrTransactionManager->flushGraphics(); acedUpdateDisplay();
}
} pBlockTable->close (); pBlockTableRecord->close (); delete pDb; return; }
请问我的这段代码为什么刷新不了显示屏啊?
谢谢! |