Or, use a LISP routine instead of the command call:
Code:
(defun attchng (blk tag val / i ss ent att)
(vl-load-com)
;; Lee Mac ~ 17.02.10
(mapcar (function set) '(blk tag)
(mapcar (function strcase) (list blk tag)))
(if (setq i -1 ss (ssget "_X" (list (cons 0 "INSERT")
(cons 2 blk) (cons 66 1))))
(while (setq ent (ssname ss (setq i (1+ i))))
(foreach att (vlax-invoke (vlax-ename->vla-object ent) 'GetAttributes)
(if (eq (strcase (vla-get-TagString att)) Tag)
(vla-put-TextString att val)))))
(princ))
Call it in your script like this;
Code:
(attchng "blockname" "tagname" "newtagvalue")
But you will need to make sure it is being loaded in every drawing.
Bookmarks