尺寸前缀切换
标注一轴,表示直径时前面要加φ,修改标注方式很麻烦,可以集中在“处理标注”的工具中;;11 尺寸前加前缀φ
(defun A-DIMENSION-Pre (/ E N OBJ SS TEXTOVERRIDE)
(while (and (setvar "nomutt" 1)
(princ "\n 选择尺寸,切换前缀φ")
(setq ss (ssget ":S" '((0 . "*DIMENSION"))))
(setvar "nomutt" 0)
)
(repeat (setq n (sslength ss))
(setq e (ssname ss (setq n (1- n))))
(setq obj (vlax-ename->vla-object e))
(setq TextOverride (vlax-get obj 'TextOverride))
(if (= "" TextOverride)
(if (= (vla-get-TextPrefix obj) "%%C")
(vla-put-TextPrefix obj "")
(vla-put-TextPrefix obj "%%C")
)
(if (or(wcmatch TextOverride "*%%C*")
(wcmatch TextOverride "*%%c*")
(wcmatch TextOverride "*φ*")
)
(progn
(while (VL-STRING-SEARCH "%%C" TextOverride)
(setq TextOverride
(VL-STRING-SUBST "" "%%C" TextOverride)
)
)
(while (VL-STRING-SEARCH "%%c" TextOverride)
(setq TextOverride
(VL-STRING-SUBST "" "%%c" TextOverride)
)
)
(while (VL-STRING-SEARCH "φ" TextOverride)
(setq TextOverride
(VL-STRING-SUBST "" "φ" TextOverride)
)
)
(vla-put-TextOverride obj TextOverride)
)
(vla-put-TextOverride obj (strcat "%%C" TextOverride))
)
)
)
)
(setvar "nomutt" 0) ;空选时执行
)
大神工具箱能分享吗?
谢谢大神分享吗? 这个工具箱看起来很不错的样子 楼主辛苦了,如果能加弧长符号就好了,比如要画一个弧形的展开面,在展开面所有的尺寸前加弧形符号。 月下闲人 发表于 2022-11-18 10:28
楼主辛苦了,如果能加弧长符号就好了,比如要画一个弧形的展开面,在展开面所有的尺寸前加弧形符号。
弧形可以在标注时直接产生 http://bbs.mjtd.com/thread-186547-1-1.html?_dsign=45057c20 谢谢楼主分享! 楼主给力,谢谢分享!!!
页:
[1]