ya雀无声 10:40:16
;;功能:带提示、关键字、过滤表、选择错误时的提示并且会亮显所选对像的entsel
;;用法:( clh-entsel 提示信息 关键字 过滤表 选择错误时提示)
;;举例:(clh-entsel "\n请选择一个圆:" "A B C" '((0 . "circle")) "\n所选对像不符合要求!请重新选择:")
;;说明:过滤表与ssget的过滤表相同;函数由CLH521,2009.6.7参考了一些网上资料整理编写
(defun clh-entsel (msg key fil ermsg / el ss)
(while (and (setvar "errno" 0)
(not (and (setq el (apply '(lambda (msg key) (initget key) (entsel msg)) (list msg key)))
(if (= (type el) 'str)
el
(if (setq ss (ssget (cadr el) fil))
ss
(progn (princ ermsg) (setq ss nil))
);if
);if
);and
);not
(/= (getvar "errno") 52)
);and
);while
(if (= (type el) 'list) (redraw (car el) 3));亮显选中的对像
el
)
;clh-entsel函数完毕========================================================