ccc230
发表于 2017-10-14 22:26:31
下了个谢谢楼主
唐伯虎9527
发表于 2017-11-17 13:55:56
(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)
)
NEWMEN
发表于 2017-12-14 23:46:39
看起来很不错哦,赶紧试一下
730527
发表于 2018-3-19 16:32:50
好程序,谢谢,谢谢
zhangkui9070
发表于 2020-7-25 09:09:37
厉害啊,崇拜中
huxu823
发表于 2020-7-26 20:50:06
为什么我用不了呢,一输入文字就提示错误,大家都没这个问题吗?
hnzkhyyl
发表于 2021-1-29 10:47:31
很好用,谢谢分享
goodt
发表于 2021-10-28 11:04:13
很不错
xzd716
发表于 2021-11-30 20:41:13
实用程序!
lwcox
发表于 2021-12-4 20:33:06
谢谢楼主,学习了!!!