试一下这个,不记得原作者是谁了,应该是来源于本论坛。
- ;;;(Get_Key_Word "\n1实体/2钢筋砼/3素砼/4墙体/5阳台/6卫生间/7厨房:<1>"'("1" "2" "3" "4" "5" "6" "7") "1")
- (defun Get_Key_Word(pro lst def / kw val)
- (setq lst (apply 'append (mapcar '(lambda(e) (list (ascii (strcase e)) (ascii (strcase e T)))) lst)) def (ascii def))
- (prompt pro)
- (while (not (and (setq kw (grread nil) val (car kw) kw (cadr kw)) (member val '(2 11 25))
- (if (or (= val 25) (and (= val 11) (= kw 0)) (member kw '(13 32))) (setq kw def) (member kw lst)))))
- (strcase (vl-list->string (list kw))))
|