- (defun c:test (/ a1 el str)
- (setq txt5 (ukword
- 1
- "1 2 3 4 5 6 7 8 9"
- "\n请选择括号形式:1-()/2-()/3-{}/4-[]/5-〔〕/6-「」/7-『』/8-〖〗/9-【】"
- txt5
- )
- a1 (car (entsel "\n请选择文字 : "))
- el (entget a1)
- str (dxf 1 el)
- )
- (khxs)
- (setq a1 (subst (cons 1 str) (ASSOC 1 el) el)
- )
- (entmod a1)
- (princ)
- )
- (defun dxf (code elist) (cdr (assoc code elist)))
- (defun khxs ()
- (cond ((= txt5 "1") (setq str (strcat "(" str ")")))
- ((= txt5 "2") (setq str (strcat "(" str ")")))
- ((= txt5 "3") (setq str (strcat "{" str "}")))
- ((= txt5 "4") (setq str (strcat "[" str "]")))
- ((= txt5 "5") (setq str (strcat "〔" str "〕")))
- ((= txt5 "6") (setq str (strcat "「" str "」")))
- ((= txt5 "7") (setq str (strcat "『" str "』")))
- ((= txt5 "8") (setq str (strcat "〖" str "〗")))
- ((= txt5 "9") (setq str (strcat "【" str "】")))
- (t (setq str (strcat "(" str ")")))
- )
- )
- (defun ukword (bit kwd msg def / inp)
- (if (and def (/= def ""))
- (setq msg (strcat "\n" msg "<" def ">:")
- bit (* 2 (fix (/ bit 2)))
- )
- (setq msg (strcat "\n" msg ":"))
- )
- (initget bit kwd)
- (setq inp (getkword msg))
- (if inp
- inp
- def
- )
- )
- (defun c:jkh()(c:test))
|