- ;;清理dwg文件,目前在使用过程中好像使图纸出现无法复制到剪切板的情况,不太确定
- (defun c:aww
- (/ doc nod dict_names start_time cost_time acad_ver)
- (setvar "CMDECHO" 0)
- (setq start_time (getvar "millisecs"))
- (vl-catch-all-apply
- '(lambda
- (setq acad_ver (atoi (substr (getvar "ACADVER") 2)))
- (setq
- doc (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- (princ "\n执行图形审计...")
- (vl-cmdf "_.AUDIT" "Y");
- (princ "\n清理DGN线型字典...")
- (setq nod (namedobjdict))
- (if
- (dictsearch nod "ACAD_DGNLINESTYLECOMP")
- (dictremove nod "ACAD_DGNLINESTYLECOMP")
- )
- (princ "\n删除冗余系统字典...")
- (setq
- dict_names '("ACAD_SCALELIST"
- "ACAD_TABLESTYLE"
- "ACAD_VISUALSTYLE"
- "ACDB_RECOMPOSE_DATA"
- "ACAD_MLEADERSTYLE"
- )
- )
- (mapcar
- '(lambda
- (x)
- (if (dictsearch nod x) (dictremove nod x))
- )
- dict_names
- )
- (princ "\n深度清理冗余对象...")
- (vla-PurgeAll doc)
- (vl-cmdf "_.PURGE" "_ALL" "" "_NO")
- (princ "\n重置缩放比例列表...")
- (vl-cmdf "-SCALELISTEDIT" "RESET" "Y" "DELETE" "*" "EXIT" ))
- )
- (setvar "CMDECHO" 1)
- (setq cost_time (/(-(getvar "millisecs") start_time) 1000.0)
- )
- (princ
- (strcat
- "\n 清理完成!"
- "\n总耗时:"
- (rtos cost_time 2 2)
- "秒"
- )
- )
- (princ)
网友答: 赞,支持,有些外来图纸问题是真多网友答: 可能是系统原因,略加修改,好用
网友答: "ACAD_TABLESTYLE"清理后可能文件会报错