<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EDIT ATTRIBUTE VALUE WITH LISP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927690#M122676</link>
    <description>&lt;P&gt;ENTMOD works but you have to drill to the ATTRIB entity in each&amp;nbsp;INSERT instance and use it on that entity.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 20:31:11 GMT</pubDate>
    <dc:creator>hencoop</dc:creator>
    <dc:date>2017-03-07T20:31:11Z</dc:date>
    <item>
      <title>EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927162#M122671</link>
      <description>&lt;P&gt;I am trying to get the below code to work and I am not having any luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it could be an issue with wcmatch because I am using #.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to change the values of the tags for all the blocks that are in a particular drawing.&lt;/P&gt;&lt;P&gt;So I tried to enter " * " for all blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I have tag named "ITEM %" (This name can change, but this is the name in this example) and I use "ITEM\u+0020%" if that matters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The old value is # and the new value will be %.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun changeAttribValue (ent atttag oldval newval / entl)
  (while (and ent (/= "SEQEND" (cdr (assoc 0 (setq entl (entget ent))))))
    (and (= atttag (cdr (assoc 2 entl)))
         (= oldval (cdr (assoc 1 entl))) ;&amp;lt;- could use WCMATCH instead
         (entmod (subst (cons 1 newval) (assoc 1 entl) entl))
         (entupd ent)
         (mapcar 'princ (list "\n" oldval " -&amp;gt; " newval))
    )
    (setq ent (entnext ent))
  )
)

(defun C:CHATTRIB2 (/ ss a attag bname oldval newval)
  (and (/= "" (setq bname (getstring "\nBlock name: ")))
       (/= "" (setq tag (getstring T "\nFind Tag: ")))
       (/= "" (setq value (getstring T "\n:With Value: ")))
       (/= "" (setq attag (getstring T "\nTag: ")))
       (/= "" (setq oldval (getstring T "\nOld value: ")))
       (/= "" (setq newval (getstring T "\nNew value: ")))
       (setq a  0
             ss (ssget "X" (list '(0 . "INSERT") '(66 . 1) (cons 2 bname)))
       )
       (repeat (sslength ss)
         (changeAttribValue (ssname ss a) attag oldval newval)
         (setq a (1+ a))
       )
  )
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:26:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927162#M122671</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-07T17:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927231#M122672</link>
      <description>&lt;P&gt;Hi, Kyle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My first reaction is that this would be better off using a dialog box where the oldval is provided and the user has a text_box for entering a newval, instead of all that typing (which fosters human error).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding wcmatch, remember that certain characters are wildcards, like *, #, and ?, so if you want to match one of those characters literally, you have to reverse quote it like `#.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, (wcmatch "TAG#" "*#") would return nil because the last character is not a number,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; but&lt;/P&gt;
&lt;P&gt;(wcmatch "TAG#" "*`#") would return T because the preceding reverse quote makes the following character literal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think that % is a wildcard character.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927231#M122672</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-03-07T17:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927254#M122673</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I have something like that already, because I ran into this problem with the # in defining the tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:attr_rename_list ( / elst enm i new nmeLst old ss)

  (setq nmeLst ; All tags must be upper case.
    (list
      ;     OLD                                     NEW
      (list "#" "ITEM\U+0020%") ; \U+00A0 = Unicode non-breaking space.
      (list "I"                                  "#")
    )
  )

  (if (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1))))
    (repeat (setq i (sslength ss))
      (setq enm (ssname ss (setq i (1- i))))
      (while
        (and
          (setq enm (entnext enm))
          (setq elst (entget enm))
          (= "ATTRIB" (cdr (assoc 0 elst)))
        )
        (if (setq new (cadr (assoc (setq old (cdr (assoc 2 elst))) nmeLst)))
          (progn
            (entmod (subst (cons 2 new) (cons 2 old) elst))
            (princ (strcat "\n" old " --&amp;gt; " new " "))
          )
        )
      )
    )
  )
  (princ)
)&lt;/PRE&gt;&lt;P&gt;That's the code I have.&amp;nbsp; The one problem I have with that code is that when it changes the tag name it's not permanent and when I attsync it goes back to normal, because it's not actually changing the tag in the block.&amp;nbsp; What I would like the prog to do is to change the tag name, then ask to change the prompt and then finally ask to change the value permanently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be preferable to enter the values into the code so that it's all automated as I think you're suggesting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind of like the last code you made for me.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:58:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927254#M122673</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-07T17:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927620#M122674</link>
      <description>&lt;P&gt;I use this routine for changing attribute values in multiple blocks of the same name:&lt;/P&gt;&lt;P&gt;It requires a lisp statement to use it. &amp;nbsp;E.g. (attupdm "&amp;lt;block name&amp;gt;" "&amp;lt;attribute tag&amp;gt;" "&amp;lt;new value&amp;gt;")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun attupdm (blockname attribname newvalue / ttl1ss iniblk inient nxtent)
  (setq ttl_exst nil
	bstp 0)
  (if
    (setq ttl1ss (ssget	;"x"
			(list (cons -4 "&amp;lt;and")
			  (cons 0 "INSERT")
			  (cons 2 blockname)
			  (cons -4 "and&amp;gt;")
			 )
		 ) ;_ end of ssget
    ) ;_ end of setq
    (while (&amp;lt; bstp (sslength ttl1ss))
     (progn
       (setq iniblk (ssname ttl1ss bstp))
       (setq inient (entget iniblk))
       (setq nxtent (entget (entnext iniblk)))
       (while (/= (cdr (assoc 0 nxtent)) "SEQEND")
	 (if (eq (cdr (assoc 0 nxtent)) "ATTRIB")
	   (if (eq (strcase(cdr (assoc 2 nxtent)))(strcase attribname))
	     (progn
	       (setq nxtent
		      (subst (cons 1 newvalue) (assoc 1 nxtent) nxtent)
	       ) ;_ end of setq
	       (entmod nxtent)
	       (entupd iniblk)
	     ) ;_ end of progn
	     (if (eq (strcase(cdr (assoc 2 nxtent)))"SHT_NO.")
	       (setq cur_sht_no (cdr(assoc 1 nxtent)))
	     )
	   ) ;_ end of if
	 ) ;_ end of if
	 (setq nxtent (entget (entnext (cdar nxtent))))
       ) ;_ end of while
       (princ)
     ) ;_ end of progn
      (setq bstp (1+ bstp))
    )
     (princ)
  ) ;_ end of if
  (princ)
) ;_ end of defun&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 20:00:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927620#M122674</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-07T20:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927648#M122675</link>
      <description>Somewhere in my wad of overcooked spaghetti called a brain I think I had&lt;BR /&gt;found that (entmod) won't work on changing attribute/attdef properties, but&lt;BR /&gt;(vlax-put object 'property newvalue) will.  Try that.</description>
      <pubDate>Tue, 07 Mar 2017 20:09:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927648#M122675</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-03-07T20:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927690#M122676</link>
      <description>&lt;P&gt;ENTMOD works but you have to drill to the ATTRIB entity in each&amp;nbsp;INSERT instance and use it on that entity.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 20:31:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6927690#M122676</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-07T20:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6928541#M122677</link>
      <description>&lt;P&gt;Thank you for that information,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1152254"&gt;@hencoop&lt;/a&gt;. &amp;nbsp;"Ignorance may be bliss, but it also imposes limitations," John Uhden c. 2017.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your name really Henry Cooper? &amp;nbsp;Are you a relative of Rex Cooper? &amp;nbsp;How about Dr. Sheldon Cooper?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"coopdetat" is very clever. &amp;nbsp;I like it.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 02:15:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6928541#M122677</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-03-08T02:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6929969#M122678</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1152254"&gt;@hencoop&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your code, but I can't get it to work.&lt;/P&gt;&lt;P&gt;I need to select all of the blocks on the drawing and change all of the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what tried. (attupdm "&amp;lt;*&amp;gt;" "&amp;lt;ITEM $&amp;gt;" "&amp;lt;$&amp;gt;") It asked me to select all of the blocks which I did but it then nothing happens.&lt;/P&gt;&lt;P&gt;I also tried it by just using the name, but it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another good friend helped me with implementing the tag change in the block.&lt;/P&gt;&lt;P&gt;He did like I think you were thinking. (setq doc (vla-get-activedocument (vlax-get-acad-object)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks fellas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 14:01:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6929969#M122678</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-08T14:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930002#M122679</link>
      <description>&lt;P&gt;You do need to use the name of the block but you do not need to use the &amp;lt;&amp;gt; that brackets it. &amp;nbsp;Sorry for the confusion.&lt;/P&gt;&lt;P&gt;Try it this way (attupdm "name" "tag" "value") replacing each of the three strings with your own string.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 14:09:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930002#M122679</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-08T14:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930017#M122680</link>
      <description>&lt;P&gt;Thanks coop that works now, but I am looking to change the value in the attribute within the block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably just need to add something small to this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:AttRenList ( / doc new tagLst)

  (setq tagLst ; All tags must be upper case.
    (list
      ;     OLD                                     NEW
      (list "ITEM #"  "ITEM\U+0020$") ; \U+00A0 = Unicode non-breaking space.
      (list "#"       "ITEM\U+0020#")
    )
  )

  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-endundomark doc)
  (vla-startundomark doc)
  (vlax-for blk (vla-get-blocks doc)
    (if (= :vlax-false (vla-get-isxref blk))
      (vlax-for obj blk
        (cond
          ((= "AcDbBlockReference" (vla-get-objectname obj))
            (if (= :vlax-true (vla-get-hasattributes obj))
              (foreach att (vlax-invoke obj 'getattributes)
                (if (setq new (cadr (assoc (vla-get-tagstring att) tagLst)))
                  (vla-put-tagstring att new)
                )
              )
            )

          )
          ((= "AcDbAttributeDefinition" (vla-get-objectname obj))
            (if (setq new (cadr (assoc (vla-get-tagstring obj) tagLst)))
              (vla-put-tagstring obj new)
            )
          )
        )
      )
    )
  )
  (vla-endundomark doc)
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 14:16:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930017#M122680</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-08T14:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930254#M122681</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;(defun c:AttRenList ( / doc new tagLst)

  (setq tagLst ; All tags must be upper case.
    (list
      ;     OLD                                     NEW
      (list "ITEM #"  "ITEM\U+0020$") ; \U+00A0 = Unicode non-breaking space.
      (list "#"       "ITEM\U+0020#")
    )
  )

  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-endundomark doc)
  (vla-startundomark doc)
  (vlax-for blk (vla-get-blocks doc)
    (if (= :vlax-false (vla-get-isxref blk))
      (vlax-for obj blk
        (cond
          ((= "AcDbBlockReference" (vla-get-objectname obj))
            (if (= :vlax-true (vla-get-hasattributes obj))
              (foreach att (vlax-invoke obj 'getattributes)
                (if (setq new (assoc (vla-get-tagstring att) tagLst))
                  (progn
                    (vla-put-textstring att (cadr new))
                  )
                )
              )
            )

          )
          ((= "AcDbAttributeDefinition" (vla-get-objectname obj))
            (if (setq new (assoc (vla-get-tagstring obj) tagLst))
              (progn
                (vla-put-textstring obj (cadr new))
              )
            )
          )
        )
      )
    )
  )
  (vla-endundomark doc)
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 14:58:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930254#M122681</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-08T14:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930527#M122682</link>
      <description>&lt;P&gt;Coop sorry maybe I wasn't clear enough before, the code I had works fine for modifying the tag name withing the block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would also like it to do is to have it modify the tag value at the same time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;list "ITEM #"  "ITEM\U+0020$") ; \U+00A0 = Unicode non-breaking space.
      (list "#"       "ITEM\U+0020#")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically after I change the "tag name" to "ITEM $" etc... I would also like it to have another section for the "tag prompt", so I can change it to for example "Enter Item $" and then another section to change the "tag value" to say for example "$".&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 15:40:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930527#M122682</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-08T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930551#M122683</link>
      <description>&lt;P&gt;Do you want to set&amp;nbsp;a static new attribute value or do you need to input each one?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 15:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930551#M122683</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-08T15:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930570#M122684</link>
      <description>&lt;P&gt;Static would be better, that way I can do it from the code and group everything that I need to change all into the same drawing.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 15:46:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930570#M122684</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-08T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930867#M122685</link>
      <description>&lt;P&gt;This will change the tag, prompt, and the value (I used tag values I have in a block to test it... replace with your own please. &amp;nbsp;Note that the tag must not have any spaces.):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Sorry, I should have removed&amp;nbsp; (vlax-dump-object ...) &amp;nbsp;from the code. &amp;nbsp;I used that to debug my edits. &amp;nbsp;It is removed by this edit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:AttRenList ( / doc new tagLst)

  (setq tagLst ; All tags must be upper case.
    (list
      ;     OLD TAG       NEW TAG      PROMPT      VALUE
      (list "SEC_DET_REF" "ITEM_#" "PROMPTSTRING1" "VALUE1") ; \U+00A0 = Unicode non-breaking space.
      (list "SHT_CALL_ON" "ITEM_$" "PROMPTSTRING2" "VALUE2")
    )
  )
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-endundomark doc)
  (vla-startundomark doc)
  (vlax-for blk (vla-get-blocks doc)
    (if (= :vlax-false (vla-get-isxref blk))
      (vlax-for obj blk
        (cond
          ((= "AcDbBlockReference" (vla-get-objectname obj))
            (if (= :vlax-true (vla-get-hasattributes obj))
              (foreach att (vlax-invoke obj 'getattributes)
                (if (setq new (assoc (vla-get-tagstring att) tagLst))
                  (progn
                    (vla-put-tagstring att (cadr new))
                    (vla-put-textstring att (cadddr new))
                  )
                )
              )
            )

          )
          ((= "AcDbAttributeDefinition" (vla-get-objectname obj))
            (if (setq new (assoc (vla-get-tagstring obj) tagLst))
              (progn
                (vla-put-tagstring obj (cadr new))
                (vla-put-textstring obj (cadddr new))
                (vla-put-promptstring obj (caddr new))
              )
            )
          )
        )
      )
    )
  )
  (vla-endundomark doc)
  (princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 16:37:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6930867#M122685</guid>
      <dc:creator>hencoop</dc:creator>
      <dc:date>2017-03-08T16:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6931940#M122686</link>
      <description>&lt;P&gt;This is close except one problem, it's not changing the attribute tag inside the block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I posted on post 10 can do this, but it's only the tag name that changes and I can't change the prompt and value on that one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 20:42:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6931940#M122686</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-08T20:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6934766#M122687</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1152254"&gt;@hencoop&lt;/a&gt; well I cannot explain it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works now.&amp;nbsp; Very strange.&amp;nbsp; I appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW where in the world is the edit post button?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 16:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6934766#M122687</guid>
      <dc:creator>Kyle.para</dc:creator>
      <dc:date>2017-03-09T16:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: EDIT ATTRIBUTE VALUE WITH LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6935022#M122688</link>
      <description>&lt;P&gt;Look at the "Options" pulldown on the upper right portion of your response (after posting). &amp;nbsp;If you get there in time (I think about 5 minutes) you can edit your response. &amp;nbsp;I've actually done it once.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 18:20:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-attribute-value-with-lisp/m-p/6935022#M122688</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-03-09T18:20:14Z</dc:date>
    </item>
  </channel>
</rss>

