Here is a Lee Mac's code that I modified slightly to meet my needs:
There is a line that I want to change namely:Code:(defun c:tnm (/ dimlst doc ss) (vl-load-com) (setq dimlst '("1" "2" "3")) ;; Change as necessary (vlax-for dim (vla-get-Dimstyles (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))) (if (vl-position (vla-get-Name dim) dimlst) (progn (vla-put-activeDimstyle doc dim) (setvar "DIMCLRE" 52) (setvar "DIMCLRD" 52) (setvar "DIMCLRT" 52) (vla-copyfrom dim doc)))) (if (setq ss (ssget "_X" '((0 . "DIMENSION")))) (mapcar 'vla-update (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex ss))))) (princ))
It would be great if the application can list all the dimension styles automatically and save it to the variable dimlst.Code:(setq dimlst '("1" "2" "3")) ;; Change as necessary




Reply With Quote



Bookmarks