Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change attribute multiple paper space tabs

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
The_Caddie
3109 Views, 7 Replies

Change attribute multiple paper space tabs

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.

7 REPLIES 7
Message 2 of 8
pbejse
in reply to: The_Caddie

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.

 

Smiley Wink

 

 

 

 

Message 3 of 8
The_Caddie
in reply to: pbejse

;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

 

Message 4 of 8
pbejse
in reply to: The_Caddie


The_Caddie wrote:

....

 thats the lisp im ussing though it wont change every paperspace tab where the atribute is found

 


Remenber this:

Lisp to change attribute

 

(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

Message 5 of 8
pbejse
in reply to: pbejse

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

Message 6 of 8
dbroad
in reply to: The_Caddie

Very nice addition

Architect, Registered NC, VA, SC, & GA.
Message 7 of 8
pbejse
in reply to: dbroad


@Anonymous wrote:

Very nice addition


Thank you Doug , Just though of making it more versatile.

 

Cheers 🙂

Message 8 of 8
Anonymous
in reply to: The_Caddie

Global attribute editor

Command:  gatte

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost