由于工程加工精度的要求要改变,本人有几百张横料加工图要做以下修改,把标注为 107的改为106 38的改为39 40的改为39.5 50的改为49.5 48的改为47.5 58的改为57 由于修改量太大,图纸太多,这么多尺寸改起来也容易漏。故做了个程序。 DEFUN c:md() (vl-load-com) (setq MODDIM (ssget "x" '((0 . "dimension"))))
(setq count 0) (setq qty (sslength MODDIM)) (repeat qty (setq ename (ssname MODDIM count)) (setq objname (vlax-ename->vla-object ename)) (setq txttest (vla-get-TextOverride objname)) (setq meatest (vla-get-Measurement objname)) (if (= meatest 107.0) (vla-put-textoverride objname 106) ) (if (= txttest "107") (vla-put-textoverride objname 106) ) (if (= meatest 38.0) (vla-put-textoverride objname 39) ) (if (= txttest "38") (vla-put-textoverride objname 39) ) (if (= meatest 40.0) (vla-put-textoverride objname 39.5) ) (if (= txttest "40") (vla-put-textoverride objname 39.5) ) (if (= meatest 50.0) (vla-put-textoverride objname 49.5) ) (if (= txttest "50") (vla-put-textoverride objname 49.5) ) (if (= meatest 48.0) (vla-put-textoverride objname 47.5) ) (if (= txttest "48") (vla-put-textoverride objname 47.5) ) (if (= meatest 58.0) (vla-put-textoverride objname 57) ) (if (= txttest "58") (vla-put-textoverride objname 57) ) (setq count (+ count 1))
)
) 但此程序在我的加工图纸中不能正确运行。出现有的尺寸改了,有的尺寸就是改不了。不知为什么,小弟特来此找高手求救。望快快解答,不胜感激。附加工图和程序。大家帮我。 |