【更新—动态版】引线写入文字(源码)(线长随文字长短)
本帖最后由 【KAIXIN】 于 2012-4-26 18:52 编辑此功能是引线命令的模仿(加强个性化版)
此功能更新到动态随意拖动版(提供动态资料者QQ:147409373),很感谢!
**** Hidden Message *****
回复看看........ (defun zcx()
(setvar "osmode" 0)
;(setq p2 (getpoint P1 "\n-->请指定文字位置:")
(setq p2 (polar p1 0 10)
a1 (car p1 )
c1 (car p2)
vx (* (- (strlen TXT) 0.2) (* ht 0.75))
le vx
)
(if (< c1 a1)
(setq pp (polar p2 pi le)
p3 (polar pp (/ pi 2) zj)
)
(setq pp (polar p2 0 le)
p3 (polar p2 (/ pi 2) zj)
))
(command "line" p1 p2 "")
(setq en1 (entlast))
(command "line" p2 pp "")
(setq en2 (entlast))
(command "text" P3 ht 0 TXT)
(setq en3 (entlast))
(setq ent1 (entget en1)
ent2 (entget en2)
ent3 (entget en3))
(setq le1 (caadr (textbox ent3)))
(setq le (* 1.2 le1)
jl (* 0.1 le1))
(while (= (car (setq mouse (grread t 0 0))) 5)
(setq pt (cadr mouse))
(if (>= (car pt)(car p1))
(progn
;以下句子可自行简写
(setq ent1 (subst (cons 11 pt)(assoc 11 ent1) ent1))
(entmod ent1)
(setq ent2 (subst (cons 10 pt)(assoc 10 ent2) ent2))
(entmod ent2)
(setq ent2 (subst (cons 11 (polar pt 0 le))(assoc 11 ent2) ent2))
(entmod ent2)
(setq ent3 (subst '(72 . 0) (assoc 72 ent3) ent3))
(setq ent3 (subst (cons 10 (list (+ (car pt) jl) (+ (cadr pt) zj)))(assoc 10 ent3) ent3))
(entmod ent3)
)
(progn
(setq ent1 (subst (cons 11 pt)(assoc 11 ent1) ent1))
(entmod ent1)
(setq ent2 (subst (cons 10 pt)(assoc 10 ent2) ent2))
(entmod ent2)
(setq ent2 (subst (cons 11 (polar pt pi le))(assoc 11 ent2) ent2))
(entmod ent2)
(setq ent3 (subst '(72 . 2) (assoc 72 ent3) ent3))
(setq ent3 (subst (cons 10 (list (- (car pt) jl) (+ (cadr pt) zj)))(assoc 10 ent3) ent3))
(setq ent3 (subst (cons 11 (list (- (car pt) jl) (+ (cadr pt) zj)))(assoc 11 ent3) ent3))
(entmod ent3)
)
)
);while
(princ)
)
(defun c:KK()
(setq AA (getvar "clayer"))
(setq layer "文字 text")(if (not (tblsearch "layer" layer ))
(progn (command "layer" "new" "文字 text" "s" "文字 text" "C" 212 "" "L" "Continuous" "" "LW" 0.2 "" "")
))
(COMMAND "CLAYER" layer)
(setvar "texteval" 1)
(setvar "cmdecho" 0)
(setq vv (getvar "osmode"))
(setq ht (getreal "\n-->标注字高:(默认:2.5)"))
(if (= ht nil) (setq ht 2.5))
(setq zj (/ ht 3))
(setq n 0)
(while (= n 0)
(setq TXT (getstring "\n-->请输入文字:"))
(setvar "osmode" 33)
(if (/= txt "")
(setq p1 (getpoint "\n-->请指定点坐标:")
)
)
(if (= txt "") (setq n 1)(zcx))
)
(setvar "osmode" vv)
(princ)
)
老兄,你的帖子现在也是回复才能看啊 本帖最后由 namezg 于 2012-4-20 20:15 编辑
看看方法和我的一样不一样。用明经币,还是用自己的吧。呵呵。 谢谢楼主分享,什么级别可以没有30秒回复的限制?小木虫有将个别楼层置顶的功能,如果觉得水贴太多,可以考虑换成个别楼层置顶 k大厉害~下来研究研究 下来研究研究 牛叉,周边说出来那边就写出来了,开心正是牛人啊 谢谢楼主分享 都流行隐藏了 能否提供vlx文件