77marco77
Guest
Good evening,
to change the name of the attribute label I found this lisp
qui block attribute tag renameand do what he should.
I would like to be able to change it so that it completes the instructions even when they select between the others a block or an element that does not contain the label (at the moment by mistake and exits from the command).
if you could also ask the attribute to change and the new name without having to change each time the lisp would be the maximum, but I would be delighted with a help even only for the first part
to change the name of the attribute label I found this lisp
HTML:
(defun c:c1 ( / oldtagname newtagname tagname ss x n blk att atts )
(vl-load-com)
(setq oldtagname "aukstis")
(setq newtagname "ag")
(setq ss nill)
(prompt "\npick all blocks to change: ")
(setq ss (ssget))
(if (and (/= oldtagname "")(/= newtagname "")(/= ss nil))
(progn
(setq x 0 n 0)
(repeat (sslength ss)
(setq blk (vlax-ename->vla-object (ssname ss x)))
(if (safearray-value (setq atts (vlax-variant-value (vla-getattributes blk))))
(progn
(setq atts (vlax-safearray->list (vlax-variant-value (vla-getattributes blk))))
(foreach att atts
(setq tagname (strcase (vla-get-tagstring att))); tagname
(if (and (/= newtagname "")(= tagname oldtagname))
(progn
(vla-put-tagstring att newtagname)
(setq n (+ n 1))
); progn
); if
); foreach
); progn
); if
(setq x (+ x 1))
); repeat length ss
(alert (strcat "changed " (itoa n) " tagnames to: " newtagname))
); progn
); if
(princ)
); function
qui block attribute tag renameand do what he should.
I would like to be able to change it so that it completes the instructions even when they select between the others a block or an element that does not contain the label (at the moment by mistake and exits from the command).
if you could also ask the attribute to change and the new name without having to change each time the lisp would be the maximum, but I would be delighted with a help even only for the first part
