我想你必须Lisp程序才能做到这一点。。。。
比如:
- (defun c:le (/ lst10 str ent)
- (setq oldlay (getvar "clayer"))
- (grtext -1 "Free Lisp LE from Cad-viet @ketxu")
- ;(setvar "clayer" "KCVN-MANH") : Leader Layer,del ";" and change with your layer
- (defun loc (lst vl /) (setq lst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) vl)) lst))))
- (command "_qleader" pause pause pause)
- (command \U+001B)
- (setq ent (entget (entlast)))
- (setq lst10 (loc ent 10))
- (setq str (getstring T "\n Input String : "))
- ;(setvar "clayer" "KCVN-TEXT") ; Dtext Layer, del ";" and change with your layer
- (setq mp (mapcar '+ (nth 1 lst10) (nth 2 lst10))
- mp (mapcar '* mp '(0.5 0.5 0.5)))
- (wtxt_l str (mapcar '+ mp '(0.0 0.7 00))) ; 0.7 : space from text to Line Leader along Y axis
- (setvar "clayer" oldlay)
- )
- (defun wtxt_l(txt p / sty d h1 h2 wf h) ;;;Write txt on graphic screen at p, midle bottom
- (setq sty (getvar "textstyle")
- d (tblsearch "style" sty)
- h1 (cdr (assoc 40 d))
- h2 (cdr (assoc 42 d))
- wf (cdr (assoc 41 d)))
- (if (> h1 0) (setq h h1) (setq h h2))
- (entmake (list (cons 0 "TEXT") (cons 7 sty) (cons 40 h) (cons 41 wf)(cons 72 1)(cons 11 p) (cons 1 txt) (cons 10 p))))
|