本帖最后由 逗亦斗霸 于 2025-8-25 12:25 编辑
这个函数只能改变标注文字的位置,不能改变其方向使其和尺寸线对齐哦,用DeepSeek写了一段这样的也不行,唉~实在不行手动挡了~ - (defun c:tt (/ ss i ent obj)
- (vl-load-com)
-
- (if (setq ss (ssget '((0 . "DIMENSION"))))
- (repeat (setq i (sslength ss))
- (setq ent (ssname ss (setq i (1- i)))
- obj (vlax-ename->vla-object ent))
-
- ; 设置文字与尺寸线对齐
- (vla-put-TextInsideAlign obj :vlax-true)
- (vla-put-TextOutsideAlign obj :vlax-true)
-
- ; 设置文字旋转角度与尺寸线一致
- (vla-put-TextRotation obj (vla-get-Rotation obj))
- )
- (princ "\n未选择任何标注对象。")
- )
- (princ)
- )
|