<?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: Select and filter blocks with unique attributed text in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771944#M88924</link>
    <description>&lt;P&gt;OK, hope I understood you better now. Try and see.&lt;/P&gt;
&lt;P&gt;All blocks in current space only. Cannot hold the active selection set across layouts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:SelectAttUnique (/ ss i en em lst at as sn)
  
  (if (setq ss (ssget "_X" (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'ctab)))))
    (progn
      (repeat (setq i (sslength ss))
	(setq en (ssname ss (setq i (1- i)))
	      em en)
	(while (= "ATTRIB" (cdr (assoc 0 (entget (setq em (entnext em))))))
	  (setq at (cdr (assoc 1 (entget em)))
		lst (if (setq as (assoc at lst))
		      (subst (list at)
			     as
			     lst)
		      (cons (list at en) lst)))))
      (setq sn (ssadd))
      (foreach e (vl-remove-if-not '(lambda (x) (= (length x) 2)) lst)
	(ssadd (cadr e) sn))
      (if (&amp;gt; (sslength sn) 0)
	(sssetfirst nil sn))))
  (princ)
  )&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 May 2019 19:59:32 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2019-05-05T19:59:32Z</dc:date>
    <item>
      <title>Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771810#M88919</link>
      <description>&lt;P&gt;I'm not sure if anyone can help but I have been researching and trying to find a lisp routine where you can select entire drawing and it will filter out and select only the blocks with unique attributed text. For example, the block is called D-LIST-WATER but the attribute ID may have V4, V8 for water valves. There are several of these callouts but I want to be able to select all of them but have it filter out only one V4 and V8.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, it would be great if it can filter out these call outs and put it in a key note list that we can place on the sheets but filtering out the attributes would work as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have any suggestions or a lisp routine that can do this?&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 16:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771810#M88919</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-05T16:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771820#M88920</link>
      <description>&lt;P&gt;The FIND command is not enough for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Search for "V[48]"&amp;nbsp; check field List of values, Use wildcards, Search blocks, Block Att Value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the&amp;nbsp;&lt;A href="https://autode.sk/2ZZK2Kw" target="_blank" rel="noopener"&gt;SCREENCAST&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;See&amp;nbsp;&lt;A href="http://help.autodesk.com/view/ACD/2019/ENU/?guid=GUID-68373F99-17F1-4AC4-8D37-184C49164705" target="_blank" rel="noopener"&gt;HELP&lt;/A&gt;&amp;nbsp;of wildcards.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 17:20:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771820#M88920</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-05T17:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771874#M88921</link>
      <description>&lt;P&gt;Obviously, the find command will not select all the blocks with unique or the same attributes so I'm not sure what the "find isn't good enough" was about because that is not what I am trying to accomplish. Again, I am trying to select all of the blocks that have unique attributes such as, only one block with V4, one with V6, one with T4, one with T6...etc. This is so we can pull out these callouts without having to sort through what's there and not.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 18:31:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771874#M88921</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-05T18:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771884#M88922</link>
      <description>&lt;P&gt;Missed the work 'unique', obviously. So FIND is not enough, got it.&lt;/P&gt;
&lt;P&gt;So collect unique att values across all tags of all blocks in the drawing, right? Or exclude all that are more than once.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 18:47:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771884#M88922</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-05T18:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771890#M88923</link>
      <description>&lt;P&gt;Yes, select all the unique attribute values across all tags of all blocks and exclude the ones that are duplicated attribute valves for those blocks. That way, I can pull the unique attribute values and organize them into a call out list for the sheets. If I can select only the blocks that has the unique values, then I don't need to thumb thru the entire drawing trying to remember what call out numbers were used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 18:52:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771890#M88923</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-05T18:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771944#M88924</link>
      <description>&lt;P&gt;OK, hope I understood you better now. Try and see.&lt;/P&gt;
&lt;P&gt;All blocks in current space only. Cannot hold the active selection set across layouts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:SelectAttUnique (/ ss i en em lst at as sn)
  
  (if (setq ss (ssget "_X" (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'ctab)))))
    (progn
      (repeat (setq i (sslength ss))
	(setq en (ssname ss (setq i (1- i)))
	      em en)
	(while (= "ATTRIB" (cdr (assoc 0 (entget (setq em (entnext em))))))
	  (setq at (cdr (assoc 1 (entget em)))
		lst (if (setq as (assoc at lst))
		      (subst (list at)
			     as
			     lst)
		      (cons (list at en) lst)))))
      (setq sn (ssadd))
      (foreach e (vl-remove-if-not '(lambda (x) (= (length x) 2)) lst)
	(ssadd (cadr e) sn))
      (if (&amp;gt; (sslength sn) 0)
	(sssetfirst nil sn))))
  (princ)
  )&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 May 2019 19:59:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771944#M88924</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-05T19:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771948#M88925</link>
      <description>&lt;P&gt;Thank you, I briefly tested it and it seems to me working but I'll look at it more later. Is there a way where it will allow you to "select" all the blocks in the drawing manually instead of selecting it for you automatically?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I really appreciate your help!&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 20:02:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771948#M88925</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-05T20:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771950#M88926</link>
      <description>&lt;P&gt;Just remove the "_X".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SSGET is the function that makes the selection. Look&amp;nbsp;&lt;A href="http://www.lee-mac.com/ssget.html" target="_blank" rel="noopener"&gt;HERE&lt;/A&gt;&amp;nbsp;for more details if you're interested.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2019 20:06:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771950#M88926</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-05T20:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771971#M88927</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7175943"&gt;@kheck6VR8C&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my version. command FLRBLK (filter blocks)&lt;/P&gt;
&lt;P&gt;it will pause at:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Attribute value to scan:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;your reply could be any attribute value or you can specify&amp;nbsp;&lt;SPAN&gt;a wild-card pattern match the same as may specified in&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-AutoLISP/files/GUID-EC257AF7-72D4-4B38-99B6-9B09952A53AD-htm.html" target="_blank" rel="noopener"&gt;&amp;gt;&amp;gt; (wcmatch) &amp;lt;&amp;lt;&lt;/A&gt;&amp;nbsp; function&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;enjoy&lt;/P&gt;
&lt;P&gt;moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:flrblk (/ scan_attrib ; local function
		   pattern ss0 ss1 AcDbBlockReference attributes^)
  
 (defun scan_attrib ()
  (vl-some
   '(lambda (AcDbAttrib)
     (wcmatch (vla-get-textString AcDbAttrib) pattern)
    )  
   attributes^
  )
 ); scan_attrib
  
 (if (and
       (/= (setq pattern (getstring "\nAttribute value to scan: ")) "")
       (setq ss0 (ssget "_x" '((0 . "insert") (66 . 1))))
     )
  (progn 
   (setq ss1 (ssadd))
   
   (foreach ename (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss0)))
    (setq AcDbBlockReference (vlax-ename-&amp;gt;vla-object ename))
    (setq attributes^ (vlax-invoke AcDbBlockReference 'GetAttributes))
    (if (scan_attrib)
     (ssadd ename ss1)
    )

    (foreach obj attributes^
     (vlax-release-object obj)
    )

    (vlax-release-object AcDbBlockReference) 
   ); foreach

   (sssetfirst nil ss1)
  ); progn 
 ); if

 (princ) 
); c:fltblk

&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 May 2019 20:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8771971#M88927</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-05-05T20:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772139#M88928</link>
      <description>&lt;P&gt;You can replace the&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(getstring "\nAttribute value to scan: ")&lt;/PRE&gt;
&lt;P&gt;With a nentsel that returns the attribute value you are looking for, so becomes a pick option, can make it loop so look for more than 1 attribute value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq pattern (cdr (assoc 1 (entget (car(nentsel "select attribute"))))))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 01:46:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772139#M88928</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2019-05-06T01:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772253#M88929</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and what if the attribute value i'm looking is off screen and i do not know where it exist?&lt;/P&gt;
&lt;P&gt;beside that, the pattern that you specifies for (wcmatch) is not always the attribute value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 05:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772253#M88929</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2019-05-06T05:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772840#M88930</link>
      <description>&lt;P&gt;Thanks, the code below does exactly what I want where you can select everything in the drawing and filter out the unique values. But, to take it one step further, is there a way that you can take the blocks that are selected based upon the attribute value and have the blocks automatically stacked in a list format, in alphabetical order based upon the attribute value? The code only selects the blocks randomly and I need to manually stack them by moving them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;(vl-load-com)&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT style="background-color: #ffffff;"&gt;(defun c:SelectAttUnique (/ ss i en em lst at as sn)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; (if (setq ss (ssget (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'ctab)))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (repeat (setq i (sslength ss))&lt;BR /&gt;&amp;nbsp;(setq en (ssname ss (setq i (1- i)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; em en)&lt;BR /&gt;&amp;nbsp;(while (= "ATTRIB" (cdr (assoc 0 (entget (setq em (entnext em))))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (setq at (cdr (assoc 1 (entget em)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;lst (if (setq as (assoc at lst))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (subst (list (list at))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (cons (list at en) lst)))))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (setq sn (ssadd))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (foreach e (vl-remove-if-not '(lambda (x) (= (length x) 2)) lst)&lt;BR /&gt;&amp;nbsp;(ssadd (cadr e) sn))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (if (&amp;gt; (sslength sn) 1)&lt;BR /&gt;&amp;nbsp;(sssetfirst nil sn))))&lt;BR /&gt;&amp;nbsp; (princ)&lt;BR /&gt;&amp;nbsp; )&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 May 2019 11:23:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772840#M88930</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-06T11:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772865#M88931</link>
      <description>&lt;P&gt;Never mind.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 11:43:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772865#M88931</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-06T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772891#M88932</link>
      <description>&lt;P&gt;I attached a drawing to show the before and after of what I am trying to do. Hope that helps&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 11:53:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772891#M88932</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-06T11:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772902#M88933</link>
      <description>&lt;P&gt;Sorry, the T1 and T3 aren't shown in alphabetic order in the example&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 11:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772902#M88933</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-06T11:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772980#M88934</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;P&gt;...&lt;/P&gt;
&lt;P&gt;So collect unique att values across &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;STRIKE&gt;all &lt;/STRIKE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;tags &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ID only&lt;/STRONG&gt;&lt;/FONT&gt; of all blocks in the drawing, right? Or exclude all that are more than once.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From your DWG I see that I should fix my previous statement!!!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 12:29:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772980#M88934</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-06T12:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772996#M88935</link>
      <description>&lt;P&gt;Yes, collect all the unique attribute across all blocks and exclude the ones that are duplicates. The code you wrote did exactly that but it would be helpful to put them in a list format. Basically, what I do with your code is once they are all selected based upon the attribute unique value, I copy them to off to the side so I can organize them into a list and then I'll take that list and put them onto the sheet for our call out list. By having them automatically placed in a list format in &lt;FONT style="background-color: #ffffff;"&gt;alphabetical&lt;/FONT&gt; order, it would eliminate the step of moving and organizing them into a list.&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #666666; font-family: &amp;amp;quot; artifakt&amp;amp;quot;,tahoma,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 12:35:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8772996#M88935</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-06T12:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775188#M88936</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7175943"&gt;@kheck6VR8C&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, collect all the unique attribute across all blocks and exclude the ones that are duplicates. The code you wrote did exactly that...&lt;/P&gt;
&lt;P style="box-sizing: border-box; color: #666666; font-family: &amp;amp;quot; artifakt&amp;amp;quot;,tahoma,helvetica,arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; margin: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I tell you that is not good enough, believe me. I wrote the routine...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, the following code includes two routines.&lt;/P&gt;
&lt;P&gt;The moving part is taken from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;'s routine in other thread... and little modified by me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:SortUniqueBlks (/ *error* :addzero doc ss i en em lst val ass sn n blk minpt maxpt LL insX refY ins0)
  
  (defun *error* (errmsg)
    (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
      (princ (strcat "\nError: " errmsg)))
    (vla-endundomark doc)
    (princ))
  
  (defun :addzero (s / n a)
    (setq n (substr s (1+ (strlen (setq a (vl-string-right-trim "0123456789" s))))))
    (strcat a (cond ((= (strlen n) 1) "00") ((= (strlen n) 2) "0") ("")) n))

  ; -------------------------------------------------------------------------------------------------
  
  (if (setq ss (ssget (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'ctab)))))
    (progn
      (repeat (setq i (sslength ss))
        (setq en (ssname ss (setq i (1- i)))
              em en)
        (while (= "ATTRIB" (cdr (assoc 0 (entget (setq em (entnext em))))))
          (if (= "ID" (cdr (assoc 2 (entget em))))
            (setq val (cdr (assoc 1 (entget em)))
                  lst (if (setq ass (assoc val lst))
                        (subst (list (list val))
                               ass
                               lst)
                        (cons (list val en) lst))))))
      (setq sn (ssadd))
      (foreach e (vl-sort (vl-remove-if-not '(lambda (x) (= (length x) 2)) lst)
                          (function (lambda (a b) (&amp;lt; (:addzero (car a)) (:addzero (car b))))))
        (ssadd (cadr e) sn))
      
      (if (&amp;gt; (sslength sn) 0)
        (progn
          (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object))))
          (repeat (setq n (sslength sn))
            (setq blk (ssname sn (setq n (1- n))))
            (vla-getboundingbox (vlax-ename-&amp;gt;vla-object blk) 'minpt 'maxpt)
            (setq LL (vlax-safearray-&amp;gt;list minpt))
            (if insX
              (progn
                (command "_.move" blk ""
                         "_none" (list (cadr (assoc 10 (entget blk))) (cadr LL))
                         "_none" (list insX (+ refY 0)))
                (vla-getboundingbox (vlax-ename-&amp;gt;vla-object blk) 'minpt 'maxpt)
                (setq refY (cadr (vlax-safearray-&amp;gt;list maxpt))); move refY up
                )
              (setq insX (cadr (assoc 10 (entget blk)))
                    refY (cadr (vlax-safearray-&amp;gt;list maxpt))
                    ins0 (list insX (cadr LL)))))
          (command-s "_.move" sn "" "_non" ins0)
          (*error* "end")))))
  (princ)
  )



(defun c:SelectUniqueBlks (/ :addzero doc ss i en em lst val ass sn)
   
  (defun :addzero (s / n a)
    (setq n (substr s (1+ (strlen (setq a (vl-string-right-trim "0123456789" s))))))
    (strcat a (cond ((= (strlen n) 1) "00") ((= (strlen n) 2) "0") ("")) n))

  ; -------------------------------------------------------------------------------------------------
  
  (if (setq ss (ssget (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'ctab)))))
    (progn
      (repeat (setq i (sslength ss))
        (setq en (ssname ss (setq i (1- i)))
              em en)
        (while (= "ATTRIB" (cdr (assoc 0 (entget (setq em (entnext em))))))
          (if (= "ID" (cdr (assoc 2 (entget em))))
            (setq val (cdr (assoc 1 (entget em)))
                  lst (if (setq ass (assoc val lst))
                        (subst (list (list val))
                               ass
                               lst)
                        (cons (list val en) lst))))))
      (setq sn (ssadd))
      (foreach e (vl-sort (vl-remove-if-not '(lambda (x) (= (length x) 2)) lst)
                          (function (lambda (a b) (&amp;lt; (:addzero (car a)) (:addzero (car b))))))
        (ssadd (cadr e) sn))
      
      (if (&amp;gt; (sslength sn) 0)
        (progn
          (command "_.regen")
          (sssetfirst nil sn)))))
  (princ)
  )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 10:00:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775188#M88936</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-05-07T10:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775279#M88937</link>
      <description>&lt;P&gt;Thank you, I really appreciate your help. I was testing it and it did do exactly what I wanted it to but there were a couple of things it was doing that I noticed which I'm not sure if you knew why.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First one, when I copy the block or multiple blocks with the same or different attribute values from one location to another, it wont select them after that. It's almost acting like, you can only use it one time and then the lisp wont select the unique attributes again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second one, when it does work, it is cutting them instead of coping them to the stacked location. Sometimes it wont cut them but most of the time, it removes them from the location they were originally placed at. It removes them about 98% of the time and that would create a problem when you have them placed throughout the fitting locations in model space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The third one, it doesn't always select all of the unique attributes; it may select some or all, not sure why. I was having it not select some fittings and I am not sure if because the blocks are being copied with the same attribute values and it's not being regenerated or refreshed thus ignoring those values as being unique or if its something else causing it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's your thoughts? I know this lisp would be a great tool and really useful to a lot of people who use callouts with unique attribute values so it would be great to have it work.&amp;nbsp; Thanks again for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 10:59:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775279#M88937</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-07T10:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select and filter blocks with unique attributed text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775397#M88938</link>
      <description>&lt;P&gt;I'm not sure if this helps in troubleshooting but it seems like instead of coping the selecting items, it is selecting and moving random blocks to a stacked format. Again, after coping several blocks of different attribute values, the lisp stops working until I change one attribute value and run the lisp again, then it adds one or two blocks to the stacked list but again, not all. Then, when I change another attribute value, it adds more blocks to the stack list until all of them appear. But, again, its moving the blocks to the stacked list instead of coping them. Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 11:58:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-and-filter-blocks-with-unique-attributed-text/m-p/8775397#M88938</guid>
      <dc:creator>kheck6VR8C</dc:creator>
      <dc:date>2019-05-07T11:58:41Z</dc:date>
    </item>
  </channel>
</rss>

