如何点击文字直接把块改成所选文字名
文字最好Text 和Mtext 都可以(defun c:tt ()
(defun dxf (code e) (cdr (assoc code (entget e))))
(setq s1 (car (entsel "\n选择文字对象: "))
t1 (DXF 1 s1)
s2 (car (entsel "\n选择图块: "))
t2 (DXF 2 s2)
)
(command "rename" "b" t2 t1)
(princ)
)
(defun c:tt (/ text blk)
(vl-load-com)
(setq text (vlax-ename->vla-object (car (entsel "\n选择文字对象:"))))
(setq blk (vlax-ename->vla-object (car (entsel "\n选择块:"))))
(setq text (vla-get-textstring text))
(setq blk (vla-get-EffectiveName blk))
(command "rename" "b" blk text)
(princ)
)
解决了 谢谢大家了.:handshake xyp1964 发表于 2022-3-31 09:50
谢谢大佬的分享666
页:
[1]