<?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: SELECTION SET ATTRIBUTE in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063295#M103675</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You are an EXCELLENT teacher !!!!&amp;nbsp;&lt;img id="robotlol" class="emoticon emoticon-robotlol" src="https://forums.autodesk.com/i/smilies/16x16_robot-lol.png" alt="Robot LOL" title="Robot LOL" /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;But the above code still does not work! because?&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jun 2018 16:56:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-12T16:56:25Z</dc:date>
    <item>
      <title>SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063023#M103672</link>
      <description>&lt;P&gt;The attached block has several att, I would like to number with a prefix TAG = Number,&lt;BR /&gt;, why does not the code work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:Test  (/ dat ent etdata found post pre ss1)
  (setq pre  (getstring "\nPrefix: ")
	post (1- (getint "\nSufix: ")))
  (while
    (setq ss1 (ssget ":s" '((0 . "insert") (66 . 1))))
    (setq found ()
	  dat   (strcat pre (itoa (setq post (1+ post))))
	  ent   (ssname ss1 0))
    (while (and (setq ent (entnext ent)) (null found))
      (setq etdata (entget ent))
      (and (= (cdr (assoc 0 etdata)) "ATTRIB")
	   (= (cdr (assoc 2 etdata)) "ADSKFACTORY:Custom.ASSET_TAG")
	   (setq found t)
	   (entmod
	     (subst (cons 1 dat) (assoc 1 etdata) etdata)
	     )
	   )
      )
    )
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jun 2018 15:07:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063023#M103672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T15:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063062#M103673</link>
      <description>You need to use the (entupd ent) function to update the block.&lt;BR /&gt;&lt;BR /&gt;See Lee's example&lt;BR /&gt;&lt;A href="http://www.lee-mac.com/attributefunctions.html" target="_blank"&gt;http://www.lee-mac.com/attributefunctions.html&lt;/A&gt;</description>
      <pubDate>Tue, 12 Jun 2018 15:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063062#M103673</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-06-12T15:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063240#M103674</link>
      <description>&lt;P&gt;Frjuniornogueira,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first, well done! i see you are trying to learn autolisp&amp;nbsp;and with your 'premission' i would like to note some coding issues starting with user input:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;(setq pre&amp;nbsp; (getstring "\nPrefix: ")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;post (1- (getint "\nSufix: ")))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;if the user fail to enter the right values this will fail so it is better to check what is comming-in in order to make sure your program will work as you design it to work (see example below)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff"&gt;(while&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq ss1 (ssget ":s" '((0 . "insert") (66 . 1))))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .......&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .......&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;the ":s" argument will let the user to select only one time. that means he can choose to select by pick or any other windows or crossing but&amp;nbsp;only&amp;nbsp;once and if he misses? it is true it is in a while loop but it is better to let the user to select objects as much as he wants and after that to interate the selection set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;(while (and (setq ent (entnext ent)) (null found))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(setq etdata (entget ent))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (and (= (cdr (assoc 0 etdata)) "ATTRIB")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (= (cdr (assoc 2 etdata)) "ADSKFACTORY:Custom.ASSET_TAG")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq found t)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (entmod&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt; (subst (cons 1 dat) (assoc 1 etdata) etdata)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the (entmod) function&amp;nbsp;(somehow will be failed) the (and) expression will return nil but the&amp;nbsp;while loop will end with found=T. so some times it is good to put as many test expressions and &amp;nbsp;body expression inside (and)&lt;/P&gt;&lt;P&gt;but some time not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see the&amp;nbsp;code bellow&amp;nbsp;how would i do it&lt;/P&gt;&lt;PRE&gt;(defun c:test (/ pre post ss1 found dat ent edata)
 (if (and
       (/= (setq pre  (getstring "\nPrefix: ") "")
       (not (initget (+ 2 4))
       (setq post (1- (getint "\nSufix: ")))
     )
  (progn
   (setq i -1) 
   (while (setq ss1 (ssget '((0 . "insert") (66 . 1))))
    (setq i (1+ i))
    (setq found ()
	 dat   (strcat pre (itoa (1+ post)))
	 ent   (ssname ss1 i)
    )

    (while (and (setq ent (entnext ent)) (null found))
     (setq etdata (entget ent))
     (if (and
	   (= (cdr (assoc 0 etdata)) "ATTRIB")
	   (= (cdr (assoc 2 etdata)) "ADSKFACTORY:Custom.ASSET_TAG")
	 )
      (progn	   
       (entmod (subst (cons 1 dat) (assoc 1 etdata) etdata)
       (entupd (cdar edata))
       (setq found t)
      ); progn
     ); if
    ); inner while
   ); outer while
  ); progn
 ); if
); c:test&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have a nide day&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 16:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063240#M103674</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2018-06-12T16:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063295#M103675</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You are an EXCELLENT teacher !!!!&amp;nbsp;&lt;img id="robotlol" class="emoticon emoticon-robotlol" src="https://forums.autodesk.com/i/smilies/16x16_robot-lol.png" alt="Robot LOL" title="Robot LOL" /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;But the above code still does not work! because?&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://forums.autodesk.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 16:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063295#M103675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063345#M103676</link>
      <description>&lt;P&gt;You are accessing a Block REFERENCE. You need to access the block DEFINITION&lt;/P&gt;&lt;P&gt;Get the block name from the&amp;nbsp; entity data then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#339966"&gt;;get the block entity&lt;/FONT&gt;        &lt;BR /&gt;(&lt;FONT color="BLUE"&gt;setq&lt;/FONT&gt; ent (&lt;FONT color="BLUE"&gt;tblobjname&lt;/FONT&gt; &lt;FONT color="MAROON"&gt;"block"&lt;/FONT&gt; blkname))

(&lt;FONT color="BLUE"&gt;while&lt;/FONT&gt; (&lt;FONT color="BLUE"&gt;setq&lt;/FONT&gt; ent (&lt;FONT color="BLUE"&gt;entnext&lt;/FONT&gt; ent))&lt;FONT color="#339966"&gt;;loop through block entities&lt;/FONT&gt;            
    &lt;FONT color="#339966"&gt;;do what you need here&lt;/FONT&gt;           
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 17:23:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063345#M103676</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2018-06-12T17:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063439#M103677</link>
      <description>&lt;P&gt;I did not said i test it, only suggest good coding&lt;/P&gt;&lt;P&gt;but i will try it very soon.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 17:57:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063439#M103677</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2018-06-12T17:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063469#M103678</link>
      <description>Having re-read you initial post my above post may be wrong if you are trying to alter the text string, so&lt;BR /&gt;are you trying to access the Attribute TAG, or the Attribute text string?</description>
      <pubDate>Tue, 12 Jun 2018 18:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063469#M103678</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2018-06-12T18:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063492#M103679</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Having re-read you initial post my above post may be wrong if you are trying to alter the text string, so&lt;BR /&gt;are you trying to access the Attribute TAG, or the Attribute text string?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;The Attribute text string.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:16:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063492#M103679</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T18:16:24Z</dc:date>
    </item>
    <item>
      <title>Betreff: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063520#M103680</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@Anonymous i can only write about plain AutoCAD:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You posted a DWG which contain dynamic parameters,&lt;/P&gt;
&lt;P&gt;so that is a dwg to use 'as Block'(-definition)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to edit the block(definition) = You want to edit this uploaded file&lt;/P&gt;
&lt;P&gt;then you have to select attributdefinitions (ssget "_X" '((ATTDEF)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to edit blockreferences of this block (in another file, where you insert that file "as Block")&lt;/P&gt;
&lt;P&gt;then you are right to search for inserts and looking for attributes, BUT* see below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to edit the block(definition) in another file (where you insert that file "as Block")&lt;/P&gt;
&lt;P&gt;then you have to go to the block (tblobjname "BLOCK" "Rogers CC") - *I don't write about anonyme block clones*&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WHY DOES IT NOT WORK?&lt;/P&gt;
&lt;P&gt;Because blockreferences of this block doesn't have an attribut with a tag named "ADSKFACTORY:Custom.ASSET_TAG"&lt;/P&gt;
&lt;P&gt;(when the attributes are synchron to this blockdefinition)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thats the Attribut(tag)list which new inserts of this block would have:&lt;/P&gt;
&lt;P&gt;EXISTENTE&lt;BR /&gt;PROJETADO&lt;BR /&gt;NUMERO&lt;BR /&gt;TAM_RESIS&lt;BR /&gt;ID_POSTE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your Code works! f the selected blockreference have a Attribut with tag "ADSKFACTORY:Custom.ASSET_TAG"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:28:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063520#M103680</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2018-06-12T18:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063556#M103681</link>
      <description>&lt;P&gt;Then ignore my above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you only want to change one entity in one block i suggest using (nentsel) to directly select the entity&lt;/P&gt;&lt;PRE&gt;(while (setq ent (car (nentsel "\nSelect Attribute : ")))
  (setq ents (entget ent))&lt;BR /&gt;  .....&lt;BR /&gt;);end_while&lt;/PRE&gt;&lt;P&gt;will get the entity data of the attribute direct instead of looping through all the entities&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:38:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063556#M103681</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2018-06-12T18:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063617#M103682</link>
      <description>&lt;P&gt;here you are budy, it's now working&lt;/P&gt;&lt;P&gt;i choose the NUMERO attribute instead of what you 'want'?&lt;/P&gt;&lt;P&gt;you can change it to what you like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:test (/ pre post i j ss1 dat ent etdata found)
 (if (and
       (/= (setq pre (getstring "\nPrefix: ")) "")
       (not (initget (+ 2 4)))
       (setq post (getint "\nSufix: "))
     )
  (progn
   (setq j 0) 
   (while (setq ss1 (ssget '((0 . "insert") (2 . "rogers cc") (66 . 1))))
    (setq i -1)
    (repeat (sslength ss1) 
     (setq i (1+ i))
     (setq dat (strcat pre (itoa (+ post j)))
	   ent (ssname ss1 i) j (1+ j) found nil)
      
     (while (and (setq ent (entnext ent)) (not found))
      (setq etdata (entget ent))
      (if (and
	   (eq (cdr (assoc 0 etdata)) "ATTRIB")
	   (eq (strcase (cdr (assoc 2 etdata))) "NUMERO")
	  )
       (progn
        (entmod (subst (cons 1 dat) (assoc 1 etdata) etdata))
        (entupd ent)
        (setq found t)
       ); progn
      ); if
     ); inner while
    ); repeat
   ); outer while
  ); progn
 ); if

 (princ)
); c:test&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jun 2018 18:57:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063617#M103682</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2018-06-12T18:57:40Z</dc:date>
    </item>
    <item>
      <title>Betreff: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063720#M103683</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thanks for noticing !!!&lt;BR /&gt;was picking up the wrong entity.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 19:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063720#M103683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T19:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063725#M103684</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&lt;/P&gt;&lt;P&gt;It works perfectly!!!&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/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;FONT size="3"&gt;Thank you all, you guys are the best !!!&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img id="heart" class="emoticon emoticon-heart" src="https://forums.autodesk.com/i/smilies/16x16_heart.png" alt="Heart" title="Heart" /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 19:38:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8063725#M103684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T19:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8064741#M103685</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;...&amp;nbsp;&lt;STRONG&gt;the ":s" argument&lt;/STRONG&gt; will let the user to select only one time. that means he can choose to select by pick or any other windows or crossing but&amp;nbsp;only&amp;nbsp;once and&lt;STRONG&gt; if he misses&lt;/STRONG&gt;? it is true it is in a while loop but it is better to let the user to select objects as much as he wants and after that to iterate the selection set.&amp;nbsp;...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Using the ":s" argument has definitely its point! You can avoid noted issue of missed pick quite easily... And the rest you're saying still applies, the user can select as much objects as he wants...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Anonymous&lt;/P&gt;&lt;P&gt;Made some other improvements as well&amp;nbsp;at the code... (allowing no prefix, start with 0...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:test (/ pre n i ss1 ent etd)
  
  (setq pre (getstring "\nPrefix: "))
  (initget 4)
  (setq n (1- (cond ((getint "\nInitial number &amp;lt;1&amp;gt;: "))
		    (1))))
  
  (while (progn
	   (setvar 'ERRNO 0)
	   (setq ss1 (ssget "_:S" '((0 . "INSERT") (2 . "Rogers CC") (66 . 1))))
	   (/= (getvar 'ERRNO) 52)
	   )
    (if ss1
      (repeat (setq i (sslength ss1))
	(setq ent (ssname ss1 (setq i (1- i))))
	(while (and (setq ent (entnext ent))
		    (setq etd (entget ent))
		    (= (cdr (assoc 0 etd)) "ATTRIB")
		    )
	  (and (= (strcase (cdr (assoc 2 etd))) "NUMERO")
	       (entmod (subst (cons 1 (strcat pre (itoa (setq n (1+ n)))))
			      (assoc 1 etd)
			      etd))
	       (entupd ent)
	       )))))
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jun 2018 08:41:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8064741#M103685</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-06-13T08:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: SELECTION SET ATTRIBUTE</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8064954#M103686</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;...&amp;nbsp;&lt;STRONG&gt;the ":s" argument&lt;/STRONG&gt; will let the user to select only one time. that means he can choose to select by pick or any other windows or crossing but&amp;nbsp;only&amp;nbsp;once and&lt;STRONG&gt; if he misses&lt;/STRONG&gt;? it is true it is in a while loop but it is better to let the user to select objects as much as he wants and after that to iterate the selection set.&amp;nbsp;...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Using the ":s" argument has definitely its point! You can avoid noted issue of missed pick quite easily... And the rest you're saying still applies, the user can select as much objects as he wants...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;@Anonymous&lt;/P&gt;&lt;P&gt;Made some other improvements as well&amp;nbsp;at the code... (allowing no prefix, start with 0...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun c:test (/ pre n i ss1 ent etd)
  
  (setq pre (getstring "\nPrefix: "))
  (initget 4)
  (setq n (1- (cond ((getint "\nInitial number &amp;lt;1&amp;gt;: "))
		    (1))))
  
  (while (progn
	   (setvar 'ERRNO 0)
	   (setq ss1 (ssget "_:S" '((0 . "INSERT") &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;(2 . "Rogers CC")&lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/STRONG&gt; (66 . 1))))
	   (/= (getvar 'ERRNO) 52)
	   )
    (if ss1
      (repeat (setq i (sslength ss1))
	(setq ent (ssname ss1 (setq i (1- i))))
	(while (and (setq ent (entnext ent))
		    (setq etd (entget ent))
		    (= (cdr (assoc 0 etd)) "ATTRIB")
		    )
	  (and (= (strcase (cdr (assoc 2 etd))) "NUMERO")
	       (entmod (subst (cons 1 (strcat pre (itoa (setq n (1+ n)))))
			      (assoc 1 etd)
			      etd))
	       (entupd ent)
	       )))))
  (princ)
  )&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;One more thing, probably mentioned before, your block is a Dynamic Block. We cannot use a block name filter for the ssget function, because if you change any of dynamic features the block become a clone with its anonymous name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just remove that - it remains filtering by ATT name "NUMERO", which should be fine.&lt;/P&gt;&lt;P&gt;Or if you want to learn some, then search for how to filter blocks by An Effective name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The noted above applies on&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;'s solution as well, because I've just modified his version and did not see that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 10:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/selection-set-attribute/m-p/8064954#M103686</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2018-06-13T10:18:47Z</dc:date>
    </item>
  </channel>
</rss>

