用文字(Er)放置引线
任何身体帮助!!!用于放置带有特定层(如“错误”层)的文本的引线。! 我想你必须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)))) 我想创建一个层“错误”,它应该(文字和引线)自动放置在该层上。如何纠正?有人帮忙吗?
(defun c:测试(/p1 p2 p3)
(setvar“clayer”“Error”)
(if(和(setq p1(getpoint“\n指定引线起点:”))
(setq p2(getpoint p1“\n指定下一点:”)
)
(程序
(grdraw p1 p2 7 1)
(setq p3(getpoint p2“\n指定下一点:”)
(重新绘制)
(初始直径)
(如果p3(程序
(命令“.leader”“\u non”p1“\u non”p2”\u non“p3”\u A“”\u M“”)
(命令“.leader”“\u non”p1“\u non”p2”\u A“”\u M“”)
)
)
)
(普林斯)
) 试试这个:
(defun c:Test (/ p1 p2 p3)
(setvar "clayer" "Error")
(if (and (setq p1 (getpoint "\nSpecify leader Starting point: "))
(setq p2 (getpoint p1 "\nSpecify Next point: "))
)
(progn
(grdraw p1 p2 7 1)
(setq p3 (getpoint p2 "\nSpecify Next point <Annotation>: "))
(redraw)
(initdia)
(if p3
(command "_.leader" "_non" p1 "_non" p2 "_non" p3 "_A" "" "_M")
(command "_.leader" "_non" p1 "_non" p2 "_A" "" "_M")
)
)
)
(princ)
) 非常感谢ketxu。。这里如何定义文字高度和文字颜色
页:
[1]