- UID
- 341
- 积分
- 1337
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-11
- 最后登录
- 1970-1-1
|
发表于 2006-7-20 14:06:18
|
显示全部楼层
清理的图形部队扩展数据、扩展记录、扩展词典自定义实体等清除,但他们看不见,所以图会很大,目前AUtoCAD2002~2005的版本存在一个图层过滤器漏洞,其实就是在层表里有扩展词典ACAD_LAYERFILTERS,它记录的数据可达到几M。 2006出了一个清理功能。
编程清除的方法
- int deleteLayerFilters()
- {
-
- int maxn=30;
-
- AcDbXrecord *pXrec;
- AcDbObjectId dictObjId;
- AcDbDictionary *pDict;
-
- AcDbLayerTable *pLyrTable=NULL;
- AcDbDatabase* pCurDb = acdbHostApplicationServices()->workingDatabase();
- pCurDb->getLayerTable(pLyrTable, AcDb::kForRead);
-
- dictObjId = pLyrTable->extensionDictionary();
-
-
- acdbOpenObject(pDict, dictObjId, AcDb::kForWrite);
- AcDbObjectId entryObj;
- CString strName="ACAD_LAYERFILTERS";
- Acad :: ErrorStatus es=pDict->getAt( strName ,entryObj);
- if (es!=Acad::eOk)
- {
- pDict->close();
- pLyrTable->close();
- acedRetNil();
- return (RTNORM);
- }
-
- int rt=false;
- AcDbDictionary *pDict2;
- acdbOpenObject(pDict2, entryObj, AcDb::kForRead);
- if (pDict2->numEntries()>maxn)
- {
- pDict->remove(strName);
- rt=true;
- }
- pDict2->close();
-
- pDict->close();
- pLyrTable->close();
- if (rt)
- {
- acedRetT();
- }
- else
- {
- acedRetNil();
- }
- return (RTNORM) ;
- }
复制代码 |
|