Is there a way to change a specific attribute in a block found over x-amount of papers pace tabs?
At current I can only change one tab at a time.
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
My guess would be in your existing lisp.
(ssget "_X" (list '(0 . "INSERT")'(66 . 1)(cons 410 (getvar 'Ctab))))
it prevents selection from other layouts other than the current one.
or you included a block name on the filter and not consider anonymous names
or on the if/cond statement you comparing the block names on a list using "eq" whihc is case sensitive
or your lisp rouitne use "command" call which is limited to the current layout
or you don't have a lisp routine yet.
or it could be anything for all i know.
;FILTERING ALL MYDWGSTATUS ATTRIBUTE VALUES TO EMPTY BLANK TEXT... (command "._attedit" "N" "N" "A4LANDSCAPE" "MYDWGSTATUS" "*" "TER KONTROLE" "") (command "._attedit" "N" "N" "A4LANDSCAPE" "MYDWGSTATUS" "*" "TER BEOORDELING" "") (command "._attedit" "N" "N" "A4LANDSCAPE" "MYDWGSTATUS" "*" "DEFINITIEF" "") (command "._attedit" "N" "N" "A4LANDSCAPE" "MYDWGSTATUS" "*" "1e OPZET" "") ;RESETTING THE MYDWGSTATUS ATTRIBUTE VALUE TO TER KONTROLE... (command "._attedit" "N" "N" "A4LANDSCAPE" "MYDWGSTATUS" "*" "" "1e OPZET")
thats the lisp im ussing though it wont change every paperspace tab where the atribute is found
The_Caddie wrote:
....
thats the lisp im ussing though it wont change every paperspace tab where the atribute is found
Remenber this:
(chgatt "MYDWGSTATUS" "TER KONTROLE")
(chgatt "MYDWGSTATUS" "TER BEOORDELING")
(chgatt "MYDWGSTATUS" "DEFINITIEF")
(chgatt "MYDWGSTATUS" "1e OPZET")
We may need to modify the code to accept specific block names and/or a flag to process current or all layouts
Ok i took the liberty of coding it for you [hope dbroad doesnt mind]
(vl-load-com)
;;Change attribute value
;;Example: (chgatt "mark" "newtext")
;;DC Broad 2012 pBe 2012
(defun chgatt (bn tag value flg)
(setq tag (strcase tag) bn (strcase bn))
(if (ssget "x"
(list '(0 . "insert")
'(66 . 1)
(cons 2 (strcat bn ",`*U*"))
(cons 410
(if flg
(getvar 'Ctab)
"*"))))
(vlax-for n (vla-get-activeselectionset
(vla-get-activedocument
(vlax-get-acad-object)))
(if (eq (strcase (vla-get-effectivename n)) bn)
(foreach m (vlax-invoke n 'getattributes)
(if (= (vla-get-tagstring m) tag)
(vla-put-textstring m value)
)
)
)
)
)
)
(chgatt "BlockName" "TAG" "NewString" T);<---- T for current layout only
(chgatt "BlockName" "TAG" "NewString" nil);<----nil for All Layouts