- (defun c:DAOWST ()
-
- (setq ent (entsel "请选择要删除的对象类型:"))
- (while (not ent)
- (princ "请选择对象")
- (setq ent (entsel))
- )
- (setq entpl (entget (car ent)))
- (setq dType (assoc 0 entpl))
- (setq ss1 (ssget "X" (list dType)))
- (princ (strcat "\n找到" (rtos (sslength ss1)) "个对象\n"))
- (while (/= (sslength ss1) 0)
- (setq name (ssname ss1 0))
- (ssdel name ss1)
- (entdel name)
- )
- (princ "已全部删除")
- (princ)
- )
- (prompt "\n功能:删除同类型的所有对象。\n")
- (prompt "运行 'DAOWST' 开始\n")
- (princ)
以上可以使用。
以下的就不行了
- (defun c:DAOWST ()
- (setq ent (entsel "请选择要删除的对象类型:"))
- (while (not ent)
- (princ "请选择对象")
- (setq ent (entsel))
- )
- (setq entpl (entget (car ent)))
- (setq dType (assoc 0 entpl))
- (setq cho (getstring "\n真的要删除?(y/n)\n"))
- (if (= (strcase cho T) "y")
- (
- (setq ss1 (ssget "X" (list dType)))
- (princ (strcat "\n找到" (rtos (sslength ss1)) "个对象\n"))
- (while (/= (sslength ss1) 0)
- (setq name (ssname ss1 0))
- (ssdel name ss1)
- (entdel name)
- )
- (princ "已全部删除")
- )
- (princ "操作取消")
- )
- (princ)
- )
- (prompt "\n功能:删除同类型的所有对象。\n")
- (prompt "运行 'DAOWST' 开始\n")
- (princ)
出现这样的提示:错误: 函数错误: <Selection set: 65445>
请指点。 |