清理加保存,如果觉得卡,就把保存那段删掉,即把if整段删了
(vl-load-com)
(defun c:qs (/ gnList doc groups g)
(princ
"\n* 此程序搜索不包含任何物体的空组并清除之 *\n"
)
(command ".undo" "be")
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq groups (vla-get-groups doc))
(vlax-for g groups
(princ "\n分析组:")
(princ (vla-get-name g))
(if (< (vla-get-count g) 2)
(progn
(princ (strcat "......删除空组" (vla-get-name g)))
(vla-delete g)
)
)
(princ)
)
(setvar "cmdecho" 0)
(dictremove (namedobjdict) "ACAD_DGNLINESTYLECOMP") ;;解决,*警告* 多重从属对象。无法清理问题。
(command ".purge" "ma" "*" "n"
".purge" "mu" "*" "n"
".purge" "p" "*" "n"
".purge" "sh" "" "n"
".purge" "st" "*" "n"
".purge" "m" "*" "n"
".purge" "t" "*" "n"
".purge" "v" "*" "n"
".purge" "r" "*" "n"
".purge" "z"
".purge" "e"
"-scalelistedit" "d" "*" "e"
".qsave")
(command ".undo" "e")
(princ "***** 嘻嘻!清理&保存完成! *****")
(princ)
)
好心人能否帮我把这段代码给改一下?都能用。只是在2014CAD中,只读打开DWG时,不小心QS后,不会有只读文件保护那个提示,较为不便。想改成只读文件中保存时,有个弹出的只读文件保护,代表图形保存不成功。谢谢。
页:
1
[2]