请问acdbDatabase::purge()
void PurgeBlock(AcDbDatabase *pDb) { AcDbBlockTable *pBlockTable; pDb->getSymbolTable(pBlockTable, AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite); pBlockTable->close();
AcDbBlockTableRecordIterator *pBlkRcdItr; //块表记录浏览器 pBlockTableRecord->newIterator(pBlkRcdItr);
AcDbObjectId id; AcDbObjectIdArray idArr; for(pBlkRcdItr->start();!pBlkRcdItr->done();pBlkRcdItr->step()) { pBlkRcdItr->getEntityId(id); idArr.append(id); //向数组添加实体 } pDb->purge(idArr); //清理垃圾 pBlockTableRecord->close(); delete pBlkRcdItr; }
比如我使用cad的purge命令,看到block下面有可以purge的一些对象,使用这个函数却无法purge掉他们,请问这是怎么回事? |