<div class="blockcode"><blockquote>(defun c:ttt ( / a ss n i qz hz qz0 hz0)
(setq a (getint ":" ))
(princ)
(cond
((= a 1)
(princ "选择需要添加前后缀的线性标注:")
(princ)
(setq ss (ssget '((0 . "DIMENSION")))
n (sslength ss)
i 0
)
(setq qz (getstring "输入要添加的前缀:"))
(if
(= qz nil)
(setq qz "")
)
(setq hz (getstring "输入要添加的后缀:"))
(if
(= hz nil)
(setq hz "")
)
(while (< i n)
(setq qz0 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss i)) 'TextPrefix )
hz0 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss i)) 'TextSuffix )
)
(Vlax-Put-Property (Vlax-Ename->Vla-Object (ssname ss i)) 'TextPrefix (if (= qz0 "") qz (strcat qz qz0)))
(Vlax-Put-Property (Vlax-Ename->Vla-Object (ssname ss i)) 'TextSuffix (if (= hz0 "") hz (strcat hz0 hz)))
(setq i (+ i 1))
)
)
((= a 2)
(princ "选择需要删除前缀的线性标注:")
(princ)
(setq ss (ssget '((0 . "DIMENSION")))
n (sslength ss)
i 0
)
(while (< i n)
(Vlax-Put-Property (Vlax-Ename->Vla-Object (ssname ss i)) 'TextPrefix "")
(setq i (+ i 1))
)
)
((= a 3)
(princ "选择需要删除后缀的线性标注:")
(princ)
(setq ss (ssget '((0 . "DIMENSION")))
n (sslength ss)
i 0
)
(while (< i n)
(Vlax-Put-Property (Vlax-Ename->Vla-Object (ssname ss i)) 'TextSuffix "")
(setq i (+ i 1))
)
)
)
)
848818376 发表于 2012-12-15 15:17
没人回复,我自己来咯,作者:明经 ZZXXQQ 2008.2.12
感谢楼主分享 wx302008008 发表于 2021-11-21 16:55
感谢,NB
页:
1
[2]