给标注添加一个前缀(标注前缀)
(defun c:BB( )(command ".UNDO" "BE")
(VL-LOAD-COM)
(setq AcadObject (vlax-get-acad-object)
AcadDocument (vla-get-ActiveDocument Acadobject)
mSpace (vla-get-ModelSpace Acaddocument)
)
(setq prefix (strcat"前綴"))
;;;選擇壹個標註
(setq dimObj1 (car (entsel)))
(setq dimObj (vlax-ename->vla-object dimObj1))
;;;添加前綴
(vla-put-TextPrefix dimObj prefix)
(command ".UNDO" "E")
(princ)
)
bai0379 发表于 2020-2-24 21:27
不错,能改为框选并能输入“前缀”更hao
(defun c:tt ()
(command ".UNDO" "BE")
(setq pf (getstring "\n前缀: "))
(if (setq ss (ssget '((0 . "dim*")))
i-1
)
(while (setq s1 (ssname ss (setq i (1+ i))))
(setq ob (vlax-ename->vla-object s1))
(vla-put-TextPrefix ob pf)
)
)
(command ".UNDO" "E")
(princ)
) 不错,能改为框选并能输入“前缀”更hao 这个功能还不错
(defun c:tt ()
"尺寸标注加后缀"
(command ".UNDO" "BE")
(setq sf (getstring "\n后缀: "))
(setq i -1)
(if (setq ss (ssget '((0 . "dim*"))))
(while (setq s1 (ssname ss (setq i (1+ i))))
(vla-put-TextSuffix (vlax-ename->vla-object s1) sf)
)
)
(command ".UNDO" "E")
(princ)
)
xyp1964 发表于 2024-1-13 11:16
版主,(command ".UNDO" "BE") 加这句的意义,不明白,注释掉也能跑。 弥勒 发表于 2024-3-9 17:19
版主,(command ".UNDO" "BE") 加这句的意义,不明白,注释掉也能跑。
加不加的效果,按下Ctrl+z就可以看出来了 可以可以,蛮不错。 可以可以,谢谢 好用,nice,感谢分享。
页:
[1]