<?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: LISP find block by Block Name  AND where Attribute TAG1=*User Input* in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7275641#M116720</link>
    <description>&lt;P&gt;Here is one example.&lt;/P&gt;
&lt;PRE&gt;;;Ranjit Singh&lt;BR /&gt;;;8/3/17&lt;BR /&gt;(defun somefunc  (tagname value blockname / etdata)
 (mapcar '(lambda (x)
           (while (/= "SEQEND" (cdr (assoc 0 (setq etdata (entget (setq x (entnext x)))))))
            (and (= (cdr (assoc 0 etdata)) "ATTRIB")
                 (mapcar '(lambda (x y)
                           (and (= x (cdr (assoc 2 etdata))) (entmod (subst (cons 1 y) (assoc 1 etdata) etdata))))
                         (list tagname)
                         (list value)))))
         (mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (cons 2 blockname) '(66 . 1)))))))&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Update_Block_Attribute.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/385769i30E5F0C5D6BA1D4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Update_Block_Attribute.gif" alt="Update_Block_Attribute.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&amp;nbsp;If you want to pass ent then&amp;nbsp;change this&lt;/P&gt;
&lt;PRE&gt;(mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (cons 2 blockname) '(66 . 1)))))&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;(mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (assoc 2 (entget blockname)) '(66 . 1)))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and call the function like&lt;/P&gt;
&lt;PRE&gt;(somefunc "DESC" "NEW PART NUMBER" ent)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Update_Block_Attribute_2.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/385771i15B04CB139E33F35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Update_Block_Attribute_2.gif" alt="Update_Block_Attribute_2.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 22:46:37 GMT</pubDate>
    <dc:creator>Ranjit_Singh</dc:creator>
    <dc:date>2017-08-03T22:46:37Z</dc:date>
    <item>
      <title>LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7275593#M116719</link>
      <description>&lt;P&gt;I'm new to AutoLISP. I've gone through many tutorials most of which just show you math and how to loop. There are only a handful of tutorials that deal with acutal block manipulation which is where I struggle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen some of the great LISP functions that Lee Mac and Nate Holt (and others) have created and shared, but I have yet to find a routine that does the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1) Find the block where BLOCK NAME = "VIFCD_001" AND ATTRIBUTE &amp;nbsp;[TAG1] = "-M161"&lt;/P&gt;&lt;P&gt;(2) Inside that same block change the ATTRIBUTE [DESC] = "NEW PART NUMBER"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would prefer that "BLOCK NAME" &amp;nbsp; "TAG NAME" &amp;nbsp;and "DESC NAME" be arguments in a function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to work from this routine (below), that will change attributes of a block. The only LISP routine I know prompts the user to select the block, however, I cannot prompt the user for anything - I need the block name to be passed as an argument&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I use LISP to select the block where BLOCK NAME = "VIFCD_001" and its attribute TAG1="-M161"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;THE CALL&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;(setq ent (car (entsel)))  ;Prompts the user to select a block
(changeVars "DESC" "NEW PART NUMBER" ent)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;THE FUNCTION&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;(defun changeVars (tag newvalue ent / alist)
  (if (and (= (type ent) (read "VLA-OBJECT")) newvalue)
    (progn
      (setq alist ( vlax-invoke ent 'GetAttributes))
      (foreach a alist)
         (if (= (vla-get-tagstring a) tag)
             (vlax-put-property a 'TextString newvalue)
         );endif
       );end foreach
     );end progn
     (if (= 'ename (type ent)) 
         (reptag tag newvalue (vlax-ename-&amp;gt;vla-object ent))
     );endif
   );endif
(princ)
);end defun&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 21:57:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7275593#M116719</guid>
      <dc:creator>david.faunce</dc:creator>
      <dc:date>2017-08-03T21:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7275641#M116720</link>
      <description>&lt;P&gt;Here is one example.&lt;/P&gt;
&lt;PRE&gt;;;Ranjit Singh&lt;BR /&gt;;;8/3/17&lt;BR /&gt;(defun somefunc  (tagname value blockname / etdata)
 (mapcar '(lambda (x)
           (while (/= "SEQEND" (cdr (assoc 0 (setq etdata (entget (setq x (entnext x)))))))
            (and (= (cdr (assoc 0 etdata)) "ATTRIB")
                 (mapcar '(lambda (x y)
                           (and (= x (cdr (assoc 2 etdata))) (entmod (subst (cons 1 y) (assoc 1 etdata) etdata))))
                         (list tagname)
                         (list value)))))
         (mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (cons 2 blockname) '(66 . 1)))))))&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Update_Block_Attribute.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/385769i30E5F0C5D6BA1D4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Update_Block_Attribute.gif" alt="Update_Block_Attribute.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&amp;nbsp;If you want to pass ent then&amp;nbsp;change this&lt;/P&gt;
&lt;PRE&gt;(mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (cons 2 blockname) '(66 . 1)))))&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;(mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (assoc 2 (entget blockname)) '(66 . 1)))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and call the function like&lt;/P&gt;
&lt;PRE&gt;(somefunc "DESC" "NEW PART NUMBER" ent)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Update_Block_Attribute_2.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/385771i15B04CB139E33F35/image-size/large?v=v2&amp;amp;px=999" role="button" title="Update_Block_Attribute_2.gif" alt="Update_Block_Attribute_2.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 22:46:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7275641#M116720</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-08-03T22:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7276897#M116721</link>
      <description>&lt;P&gt;Thank you Ranjit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is helpful, however, I was hoping to have the user not select the object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This function will need to be purely automated without any prompts for the user to select objects or type inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to select the block where BLOCK NAME = VIFCD_001 &amp;nbsp;and its attribute TAG1 = "-M161"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*this command below&amp;nbsp;is wrong, but my question to you is how do I use LISP to identify a block where BLOCKNAME="VIFCD_001" AND TAG1="-M161"*&lt;/P&gt;&lt;PRE&gt;(setq ent (entsel &amp;lt;block name&amp;gt; &amp;nbsp;&amp;lt;tag name&amp;gt;))
(setq ent (entsel "VIFCD_001", &amp;nbsp;"-M161"))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 13:13:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7276897#M116721</guid>
      <dc:creator>david.faunce</dc:creator>
      <dc:date>2017-08-04T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7276978#M116722</link>
      <description>&lt;P&gt;I think I'm getting close, but can someone help? This produces a NIL value, but I believe these are the properties I need to access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq ss (ssget "_X" '((0 . "INSERT") (2 . "VIFCD_001") (5 . "1C7F"))))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the properties for two blocks (both named VIFCD_001)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Properties for Block #1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;&amp;nbsp; (-1 . &amp;lt;Entity name: 3aceb1f0&amp;gt;)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(0 . "INSERT")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(330 . &amp;lt;Entity name: 35557820&amp;gt;)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(5 . "1C7F")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(100 . "AcDbEntity")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(67 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(410 . "Model")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(8 . "Syms")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(100 . "AcDbBlockReference")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(66 . 1)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(2 . "VIFCD_001")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(10 0.0867055 5.14515e-06 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(41 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(42 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(43 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(50 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(70 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(71 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(44 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(45 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(210 0.0 0.0 1.0)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Properties for Block #2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(-1 . &amp;lt;Entity name: 3acea5b0&amp;gt;)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(0 . "INSERT")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(330 . &amp;lt;Entity name: 35557820&amp;gt;)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(5 . "1C43")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(100 . "AcDbEntity")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(67 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(410 . "Model")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(8 . "Syms")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(100 . "AcDbBlockReference")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(66 . 1)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(2 . "VIFCD_001")&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(10 145.197 0.100673 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(41 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(42 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(43 . 1.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(50 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(70 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(71 . 0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(44 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(45 . 0.0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;(210 0.0 0.0 1.0)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 13:44:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7276978#M116722</guid>
      <dc:creator>david.faunce</dc:creator>
      <dc:date>2017-08-04T13:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277169#M116723</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4523925"&gt;@david.faunce&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you Ranjit.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is helpful, however, I was hoping to have the user not select the object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This function will need to be purely automated without any prompts for the user to select objects or type inputs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to select the block where BLOCK NAME = VIFCD_001 &amp;nbsp;and its attribute TAG1 = "-M161"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*this command below&amp;nbsp;is wrong, but my question to you is how do I use LISP to identify a block where BLOCKNAME="VIFCD_001" AND TAG1="-M161"*&lt;/P&gt;
&lt;PRE&gt;(setq ent (entsel &amp;lt;block name&amp;gt; &amp;nbsp;&amp;lt;tag name&amp;gt;))
(setq ent (entsel "VIFCD_001", &amp;nbsp;"-M161"))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;There has to be some way to identify the block. Block name is one. Other could be block insertion point if you are after a particular block. If you want to update a tag in any instance of the block then you just create a selection set of all the blocks and then iterate through them. My example is good for plugging in your overall function? I thought that was the goal since you needed a function with arguments. Something like this&lt;/P&gt;
&lt;PRE&gt;(defun c:somefunc  (/ ctr ss1)
  (setq ctr 0
        ss1 (ssget "_x" '((0 . "insert") (2 . "VIFCD_001"))))
  (repeat (sslength ss1) (somefunc "DESC" "NEW PART NUMBER" (ssname ss1 ctr)) (setq ctr (1+ ctr))))

(defun somefunc  (tagname value blockname / etdata)
  (mapcar '(lambda (x)
             (while (/= "SEQEND" (cdr (assoc 0 (setq etdata (entget (setq x (entnext x)))))))
               (and (= (cdr (assoc 0 etdata)) "ATTRIB")
                    (mapcar '(lambda (x y)
                               (and (= x (cdr (assoc 2 etdata))) (entmod (subst (cons 1 y) (assoc 1 etdata) etdata))))
                            (list tagname)
                            (list value)))))
          (mapcar 'cadr (ssnamex (ssget "_x" (list '(0 . "insert") (assoc 2 (entget blockname)) '(66 . 1)))))))&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Update_Block_Attribute_3.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/386024i4F4881C957C941CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Update_Block_Attribute_3.gif" alt="Update_Block_Attribute_3.gif" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something I am missing?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 14:55:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277169#M116723</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-08-04T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277203#M116724</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4523925"&gt;@david.faunce&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I think I'm getting close, but can someone help? This produces a NIL value, but I believe these are the properties I need to access.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq ss (ssget "_X" '((0 . "INSERT") (2 . "VIFCD_001") (5 . "1C7F")))) ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.................&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You cannot use&amp;nbsp;dxf code 5 in ssget. Read &lt;A href="http://help.autodesk.com/view/ACD/2018/DEU/?guid=GUID-7BE77062-C359-4D01-915B-69CF672C653B" target="_blank"&gt;here&lt;/A&gt; &lt;EM&gt;&lt;STRONG&gt;The &lt;SAMP class="ph codeph" id="GUID-7BE77062-C359-4D01-915B-69CF672C653B__GUID-4C338C82-66DC-42CB-AD8D-6619E6FF9ABF"&gt;ssget&lt;/SAMP&gt; function recognizes all group codes except entity names (group code -1), handles (group code 5), and&amp;nbsp;....&lt;/STRONG&gt;&lt;/EM&gt; If you have the entity handle from some previous data processing and want to select an object with a particular handle, for instance, "1C7F" then call hadnet&lt;/P&gt;
&lt;PRE&gt;(handent "1C7F")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 15:02:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277203#M116724</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-08-04T15:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: LISP find block by Block Name  AND where Attribute TAG1=*User Input*</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277238#M116725</link>
      <description>&lt;P&gt;This is very helpful...I have not heard about "handent" thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 15:10:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-find-block-by-block-name-and-where-attribute-tag1-user/m-p/7277238#M116725</guid>
      <dc:creator>david.faunce</dc:creator>
      <dc:date>2017-08-04T15:10:01Z</dc:date>
    </item>
  </channel>
</rss>

