juliana207 发表于 2022-3-31 09:50:08

如何点击文字直接把块改成所选文字名

文字最好Text 和Mtext 都可以

xyp1964 发表于 2022-3-31 09:50:09


(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)
)

gaics 发表于 2022-3-31 10:18:43

(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)
)

juliana207 发表于 2022-3-31 15:19:57

解决了 谢谢大家了.:handshake

榨菜人生 发表于 2023-11-2 22:29:06

xyp1964 发表于 2022-3-31 09:50


谢谢大佬的分享666
页: [1]
查看完整版本: 如何点击文字直接把块改成所选文字名