<?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: block match a specific value by which two-block in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436121#M75975</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3747317"&gt;@jaggisingh003&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to be honest i still do not understand what do you mean by match?&lt;/P&gt;&lt;P&gt;here is my corrections to your program, please note my comments.&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;LI-CODE lang="markup"&gt;(vl-load-com) ; load activex support

(defun c:W1 (/ get_attrib_value  ; declare local function
	       l1 ss l ename AcDbBlkRef val pt ;| local variables |; )

 (defun get_attrib_value (ename tag / value)
  (setq subent (entnext ename) sube (entget subent))
  (while (and (not value)
	      (/= (cdr (assoc '0 sube)) "SEQEND")
	 )
   (if (eq (strcase (cdr (assoc '2 sube))) (strcase tag))
    (setq value (cdr (assoc '1 sube)))
   )
   (setq subent (entnext subent) sube (entget subent)) 
  ); while
   
  value 
 ); get_attrib_value

 ; here start c:W1
 (setq l1 (getvar 'CLAYER))
 (command "._layer" "_M" "WIRE RUN-1" "")
 ; No need for next call cause the "_make" option of layer command sets the new layer current 
 ; (setvar 'CLAYER "WIRE RUN-1")

 ;|; Instead of the following block

 (setq g (car (entsel "\nSelect Block: ")))
 (setq enlist (entget g))
 (setq blkType (cdr(assoc 0 enlist))) ;- Save the type of entity
  
 (if (= blkType "INSERT") ;- If the entity type is an Insert entity
  (progn
   (if (= (cdr(assoc 66 enlist)) 1);- See if the attribute flag equals one (if so, attributes follow)
    (progn
     (setq en1 (entnext g))     ;- Get the next sub-entity
     (setq enlist1 (entget en1));- Get the DXF group codes
     (setq en2 (entnext en1))   ;- Get the next sub-entity
     (setq enlist2 (entget en2))
     (setq en3 (entnext en2)) ;- Get the next sub-entity
     (setq enlist3 (entget en3))
     (setq TL (cdr (assoc 1 enlist1)))
     (setq LO (cdr (assoc 1 enlist2)))
     (setq CH (cdr (assoc 1 enlist3)))
     (setq point1 (getpoint "\nSelcted point for TL"))
     (setq point2 (getpoint "\n Selcted point for LO"))
     (setq point3 (getpoint "\n Selcted point for CH"))
     (command "text" "j" "l" point1 2 0 TL)
     (command "text" "j" "l" point2 2 0 LO)
     (command "text" "j" "l" point3 2 0 CH)
    )
   )
  )
 )|;

 ; i would replace it with this block (code lines)

 ; instead of (entsel) use (ssget) cause it has filters, saves some data checking
 (if (setq ss (ssget
		":S:E+."         ; this arg is the same (entsel)
		'((0 . "insert") ; filter only block references
		 (66 . 1))       ; has attributes
	      )
     )
  ; loop through selected blocks, remember we are talking here only for 1 block
  (repeat (setq l (sslength ss))
   (setq ename (ssname ss (setq l (1- l))))
    ; get vlax-object cause the block is dynamic 
   (setq AcDbBlkRef (vlax-ename-&amp;gt;vla-object ename))
   ; make sure we deal with "TENSION_LENGTH" block
   ; (vla-get-effectiveName) return the origin block name (not it's dynamic name) 
   (if (eq (strcase (vla-get-effectiveName AcDbBlkRef)) "TENSION_LENGTH")
    ; loop through attributes tag in concern, a list of dotted pair items to also hold the key for the prompt to (getpoint) 
    (foreach item '(("tension_length" . "TL") ("location_num" . "LO") ("chainage". "CH"))
     (if (and
	   ; next, call a local function to get attribute value (or nil if it tag not found
	   (setq val (get_attrib_value ename (car item)))
	   (setq pt (getpoint (strcat "\nPick point for " (cdr item) ": ")))
	 )
      (command "._text" "_j" "_l" pt 2 0 val)
     )
    ); foreach
      
   ); if

   (vlax-release-object AcDbBlkRef) ; dispose memory 
  ); repeat
 ); if
  
 (setvar 'CLAYER l1 )
 (princ) 
)

 &lt;/LI-CODE&gt;&lt;P&gt;@&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Apr 2020 10:24:31 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2020-04-11T10:24:31Z</dc:date>
    <item>
      <title>block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9435933#M75972</link>
      <description>&lt;P&gt;Hello everyone, I have been working on this for a few days now with no success. I want to create a lisp by I want to select all attributes values block (name Tension length) and after selection,&amp;nbsp;block match a specific value by which&amp;nbsp;two-block getting a pair and as result paste their values in the specified place.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Prompt the user to get selected the blocks in the drawing.&lt;/LI&gt;&lt;LI&gt;Use their tag tension length&amp;nbsp;to match the values with other blocks after finding the match values pair them and paste their values in a table.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PFA attached drawing file.&lt;/P&gt;&lt;P&gt;see the reference table in the end fo drawing.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 06:12:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9435933#M75972</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T06:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436009#M75973</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3747317"&gt;@jaggisingh003&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Hello everyone, I have been working on this for a few days now with no success.&lt;P&gt;&lt;FONT color="#0000FF"&gt;show us what you have done so far?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Post another dwg that shows what is a 'match'? connect\wire a match (at least 2-3 examples)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;is it possible that more then 2 block is a match?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;show us exactly how these matches should be appear in the table (each instance on a line or one line for a match?)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;how do you expect the lisp will spot the place (row, col) to place the match? cause your table is just ordinary simple lines.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;Moshe&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 08:09:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436009#M75973</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T08:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436054#M75974</link>
      <description>&lt;P&gt;hello,&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;thanks for your quick response.&lt;/P&gt;&lt;P&gt;please view the attached images so your view about the program is clear. before this, I am using this program&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;in this i can select one block and paste their attribute value as text in tabel as per user selcted points.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i wote this :-&lt;/P&gt;&lt;P&gt;(defun c:W1()&lt;BR /&gt;(setq l1 (getvar "CLAYER"))&lt;BR /&gt;(command "._layer" "_M" "WIRE RUN-1" "")&lt;BR /&gt;(setvar 'CLAYER "WIRE RUN-1")&lt;BR /&gt;(setq g (car (entsel "\nSelect Block: ")))&lt;BR /&gt;(setq enlist(entget g))&lt;BR /&gt;(setq blkType(cdr(assoc 0 enlist))) ;- Save the type of entity&lt;BR /&gt;(if (= blkType "INSERT") ;- If the entity type is an Insert entity&lt;BR /&gt;(progn&lt;BR /&gt;(if(= (cdr(assoc 66 enlist)) 1);- See if the attribute flag equals one (if so, attributes follow)&lt;BR /&gt;(progn&lt;BR /&gt;(setq en1(entnext g));- Get the next sub-entity&lt;BR /&gt;(setq enlist1(entget en1));- Get the DXF group codes&lt;BR /&gt;(setq en2(entnext en1)) ;- Get the next sub-entity&lt;BR /&gt;(setq enlist2(entget en2))&lt;BR /&gt;(setq en3(entnext en2)) ;- Get the next sub-entity&lt;BR /&gt;(setq enlist3(entget en3))&lt;BR /&gt;(setq TL (cdr (assoc 1 enlist1)))&lt;BR /&gt;(setq LO (cdr (assoc 1 enlist2)))&lt;BR /&gt;(setq CH (cdr (assoc 1 enlist3)))&lt;BR /&gt;(setq point1 (getpoint "\n Selcted point for TL"))&lt;BR /&gt;(setq point2 (getpoint "\n Selcted point for LO"))&lt;BR /&gt;(setq point3 (getpoint "\n Selcted point for CH"))&lt;BR /&gt;(command "text" "j" "l" point1 2 0 TL)&lt;BR /&gt;(command "text" "j" "l" point2 2 0 LO)&lt;BR /&gt;(command "text" "j" "l" point3 2 0 CH)&lt;BR /&gt;(setvar 'CLAYER l1 )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 09:11:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436054#M75974</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T09:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436121#M75975</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3747317"&gt;@jaggisingh003&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to be honest i still do not understand what do you mean by match?&lt;/P&gt;&lt;P&gt;here is my corrections to your program, please note my comments.&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;LI-CODE lang="markup"&gt;(vl-load-com) ; load activex support

(defun c:W1 (/ get_attrib_value  ; declare local function
	       l1 ss l ename AcDbBlkRef val pt ;| local variables |; )

 (defun get_attrib_value (ename tag / value)
  (setq subent (entnext ename) sube (entget subent))
  (while (and (not value)
	      (/= (cdr (assoc '0 sube)) "SEQEND")
	 )
   (if (eq (strcase (cdr (assoc '2 sube))) (strcase tag))
    (setq value (cdr (assoc '1 sube)))
   )
   (setq subent (entnext subent) sube (entget subent)) 
  ); while
   
  value 
 ); get_attrib_value

 ; here start c:W1
 (setq l1 (getvar 'CLAYER))
 (command "._layer" "_M" "WIRE RUN-1" "")
 ; No need for next call cause the "_make" option of layer command sets the new layer current 
 ; (setvar 'CLAYER "WIRE RUN-1")

 ;|; Instead of the following block

 (setq g (car (entsel "\nSelect Block: ")))
 (setq enlist (entget g))
 (setq blkType (cdr(assoc 0 enlist))) ;- Save the type of entity
  
 (if (= blkType "INSERT") ;- If the entity type is an Insert entity
  (progn
   (if (= (cdr(assoc 66 enlist)) 1);- See if the attribute flag equals one (if so, attributes follow)
    (progn
     (setq en1 (entnext g))     ;- Get the next sub-entity
     (setq enlist1 (entget en1));- Get the DXF group codes
     (setq en2 (entnext en1))   ;- Get the next sub-entity
     (setq enlist2 (entget en2))
     (setq en3 (entnext en2)) ;- Get the next sub-entity
     (setq enlist3 (entget en3))
     (setq TL (cdr (assoc 1 enlist1)))
     (setq LO (cdr (assoc 1 enlist2)))
     (setq CH (cdr (assoc 1 enlist3)))
     (setq point1 (getpoint "\nSelcted point for TL"))
     (setq point2 (getpoint "\n Selcted point for LO"))
     (setq point3 (getpoint "\n Selcted point for CH"))
     (command "text" "j" "l" point1 2 0 TL)
     (command "text" "j" "l" point2 2 0 LO)
     (command "text" "j" "l" point3 2 0 CH)
    )
   )
  )
 )|;

 ; i would replace it with this block (code lines)

 ; instead of (entsel) use (ssget) cause it has filters, saves some data checking
 (if (setq ss (ssget
		":S:E+."         ; this arg is the same (entsel)
		'((0 . "insert") ; filter only block references
		 (66 . 1))       ; has attributes
	      )
     )
  ; loop through selected blocks, remember we are talking here only for 1 block
  (repeat (setq l (sslength ss))
   (setq ename (ssname ss (setq l (1- l))))
    ; get vlax-object cause the block is dynamic 
   (setq AcDbBlkRef (vlax-ename-&amp;gt;vla-object ename))
   ; make sure we deal with "TENSION_LENGTH" block
   ; (vla-get-effectiveName) return the origin block name (not it's dynamic name) 
   (if (eq (strcase (vla-get-effectiveName AcDbBlkRef)) "TENSION_LENGTH")
    ; loop through attributes tag in concern, a list of dotted pair items to also hold the key for the prompt to (getpoint) 
    (foreach item '(("tension_length" . "TL") ("location_num" . "LO") ("chainage". "CH"))
     (if (and
	   ; next, call a local function to get attribute value (or nil if it tag not found
	   (setq val (get_attrib_value ename (car item)))
	   (setq pt (getpoint (strcat "\nPick point for " (cdr item) ": ")))
	 )
      (command "._text" "_j" "_l" pt 2 0 val)
     )
    ); foreach
      
   ); if

   (vlax-release-object AcDbBlkRef) ; dispose memory 
  ); repeat
 ); if
  
 (setvar 'CLAYER l1 )
 (princ) 
)

 &lt;/LI-CODE&gt;&lt;P&gt;@&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 10:24:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436121#M75975</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T10:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436163#M75976</link>
      <description>&lt;P&gt;here are my corrections to your program, please note my comments.&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp; thanks for the corrections.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I m beginner top Autolisp programming so I don't know exactly how to execute the things.&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/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;to be honest, I still do not understand what do you mean by match?&lt;/P&gt;&lt;P&gt;Ok if u see the drawings I had attached in my first post form the drawing you will get a block named "TENSION_LENGTH" with attributed values. I had used that block 4 times in that drawing.&lt;/P&gt;&lt;P&gt;from Four blocks two-block Tag "TENSION_LENGTH" (1386.00 value) have the same attribute value but other tag values are different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;So, I want to select all of them to get their tags values and match the&amp;nbsp;"TENSION_LENGTH" tag between them and get the string from all Tags&amp;nbsp;into the table already present in the drawing. like you see the table images in my second post.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 11:08:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436163#M75976</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T11:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436187#M75977</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1. table.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/752687iA0C033B6117D596D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1. table.PNG" alt="1. table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; like this attribute matching condition only "TENSION_LENGTH" TAG. try to match form all blocks attribute&amp;nbsp;"TENSION_LENGTH" TAG. if match then pairs with that values and write all the values in this table.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 11:23:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436187#M75977</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T11:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436246#M75978</link>
      <description>&lt;P&gt;Now you starting to be more clear&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;is it possible that a match would be more than 2 blocks? (could it be 3 or 4?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:17:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436246#M75978</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T12:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436262#M75979</link>
      <description>&lt;P&gt;Yes, I think Sometime when there is a lot of details.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:34:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436262#M75979</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T12:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436278#M75980</link>
      <description>&lt;P&gt;So would you know how many columns you need in table?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 12:47:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436278#M75980</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T12:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436309#M75981</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; it is depend on the drawing some times it is more than 10 columns or sometimes only 3 columns is required.&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see the attached image.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 13:09:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436309#M75981</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T13:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436582#M75982</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3747317"&gt;@jaggisingh003&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's was a bit challenge but i think i made it&amp;nbsp;so&amp;nbsp;give this a try&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the program let you select&amp;nbsp;"TENSION_LENGTH" blocks and gather them by tension_length attribute&lt;/P&gt;&lt;P&gt;(if you select other objects they will be filtered out)&lt;/P&gt;&lt;P&gt;the prompt for picking points goes like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1386.00:location_num #1/2 &amp;lt;Pick point&amp;gt;:&lt;BR /&gt;1386.00:chainage #1/2 &amp;lt;Pick point&amp;gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;each step it notes you about the current tension_length + attribute name + #x/x (current attribute out of ...)&lt;/P&gt;&lt;P&gt;thus you will know how many columns in table is needed.&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;LI-CODE lang="markup"&gt;(vl-load-com) ; load activex support

(defun c:W1 (/ tag-spiner get_attrib_value ; declare local functions
	       TAGSNAME savCLayer ss len ename AcDbBlkRef val0 val1 val2 data^ ;| local variables |; )

 (defun tag-spiner (n)
  (if (= n (length TAGSNAME)) 1 n)
 ); tag-spiner
  
 (defun get_attrib_value (ename tag / value)
  (setq subent (entnext ename) sube (entget subent))
  (while (and (not value)
	      (/= (cdr (assoc '0 sube)) "SEQEND")
	 )
   (if (eq (strcase (cdr (assoc '2 sube))) (strcase tag))
    (setq value (cdr (assoc '1 sube)))
   )
   (setq subent (entnext subent) sube (entget subent)) 
  ); while
   
  value 
 ); get_attrib_value

   
 ; here start c:W1
 (setvar 'cmdecho 0)
 (command "._undo" "_begin")
 
 (setq savCLayer (getvar 'clayer))
 (command "._layer" "_M" "WIRE RUN-1" "")

 (setq TAGSNAME '("tension_length" "location_num" "chainage")) 
  
 (if (setq ss (ssget '((0 . "insert") (66 . 1))))
  (progn
   ; build databse 
   (repeat (setq len (sslength ss))
    (setq ename (ssname ss (setq len (1- len))))
    (setq AcDbBlkRef (vlax-ename-&amp;gt;vla-object ename))
    (if (and
	  (eq (strcase (vla-get-effectiveName AcDbBlkRef)) "TENSION_LENGTH")
	  (setq val0 (get_attrib_value ename (nth 0 TAGSNAME)))
	  (setq val1 (get_attrib_value ename (nth 1 TAGSNAME)))
	  (setq val2 (get_attrib_value ename (nth 2 TAGSNAME)))
	)
     (if (assoc val0 data^)
      (progn
       (setq item (assoc val0 data^)) ; store existing item
       (setq data^ (append (reverse (cdr (member item (reverse data^)))) (cdr (member item data^)))) ; chop existing item
       (setq data^ (cons (cons val0 (list (cadr item) (list val1 val2))) data^)) ; add new item
      ); progn
      (setq data^ (cons (list val0 (list val1 val2)) data^))
     ); if
    ); if

    (vlax-release-object AcDbBlkRef) ; dispose memory 
   ); repeat

   ; insert attributes value as text
   (foreach item0 data^
    (setq i 0)
    (foreach item1 (cdr item0)
     (setq j 0 i (1+ i)) 
     (foreach item2 item1
      (if (setq pt (getpoint (strcat "\n" (car item0) ":" (nth (setq j (tag-spiner (1+ j))) TAGSNAME) " #" (itoa i) "/" (itoa (length item1)) " &amp;lt;Pick point&amp;gt;: "))) 
       (command "._text" "_j" "_l" pt 2 0 item2)
      )
     ); foreach
    ); foreach

    (setq i 0) 
    (foreach item1 (cdr item0)
     (if (setq pt (getpoint (strcat "\n" (car item0) ":" (nth 0 TAGSNAME) " #" (itoa (setq i (1+ i))) "/" (itoa (length item1)) " &amp;lt;Pick point&amp;gt;: "))) 
      (command "._text" "_j" "_l" pt 2 0 (car item0))
     )
    ); foreach
   ); foreach
   
  ); progn
 ); if
  
 (setvar 'clayer savCLayer)
 (command "._undo" "end")
 (setvar 'cmdecho 1)
  
 (princ) 
)&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 16:14:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436582#M75982</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T16:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436661#M75983</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; you are great. thanks for this help thanks a lot.&lt;/P&gt;&lt;P&gt;this will save my time. again thanks for this.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 17:15:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436661#M75983</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T17:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436663#M75984</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;one more help can you just explain this code in simple language.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 17:17:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436663#M75984</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T17:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436706#M75985</link>
      <description>&lt;P&gt;be more specific&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 17:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436706#M75985</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T17:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436724#M75986</link>
      <description>&lt;P&gt;what is this?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; (defun tag-spiner (n)
  (if (= n (length TAGSNAME)) 1 n)
 ); tag-spiner&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 18:03:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436724#M75986</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-11T18:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436799#M75987</link>
      <description>&lt;P&gt;first i made some fine tuning, hope you do not mind&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;about your question:&lt;/P&gt;&lt;P&gt;the index of items in list is zero based. meaning the first is 0, second is 1, third is 2 ....etc&lt;/P&gt;&lt;P&gt;(setq TAGSNAME '("tension_length" "location_num" "chainage"))&lt;/P&gt;&lt;P&gt;so the above expr result "tension_length" is index 0,&amp;nbsp;"location_num is index 1 and&amp;nbsp;"chainage" is index 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example: by selection 2 "TENSION_LENGTH" blocks with match "tension_length" attributes value, may result the following list:&amp;nbsp;(("1386.00" ("160/10" "160/615.00") ("185/15" "185/815.00")))&lt;/P&gt;&lt;P&gt;now, when i process it to draw the texts (due to the order of columns in your table) i first needed the&amp;nbsp;"location_num" attribute then the "chainage" than again i need next "location_num" + "chainage" (and if there were more...i need it again and again)&amp;nbsp;so when looping through TAGSNAME i need to skip the first item. there i defined the&amp;nbsp;&amp;nbsp;(tag_spiner) function to return the right index item&amp;nbsp;so if the args n reach 3 it should go back to second item which is 1 (not 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you have more question do not &lt;SPAN&gt;hesitate&lt;/SPAN&gt; to ask.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(vl-load-com) ; load activex support

(defun c:W1 (/ block_attrib_list build_data_list tag-spiner get_attrib_value draw_text ; declare local functions
	       TAGSNAME savCLayer ss len ename AcDbBlkRef lst data^ ;| local variables |; )

 (defun block_attrib_list (ent)
  (vl-remove-if
    'not
    (mapcar
     '(lambda (tag)
       (get_attrib_value ent tag)
     )
     TAGSNAME
    ); mapcar
  )
 ); block_attrib_list


 (defun build_data_list (/ item) 
  (if (assoc (nth 0 lst) data^)
   (progn
    (setq item (assoc (nth 0 lst) data^)) ; store existing item
    (setq data^ (append (reverse (cdr (member item (reverse data^)))) (cdr (member item data^)))) ; chop existing item
    (setq data^ (cons (cons (nth 0 lst) (list (cadr item) (list (nth 1 lst) (nth 2 lst)))) data^)) ; add new item
   ); progn
   (setq data^ (cons (list (nth 0 lst) (list (nth 1 lst) (nth 2 lst))) data^))
  ); if
 ); build_data_list  

  
 (defun tag-spiner (n)
  (if (= n (length TAGSNAME)) 1 n)
 ); tag-spiner
  
  
 (defun get_attrib_value (ename tag / value)
  (setq subent (entnext ename) sube (entget subent))
  (while (and (not value)
	      (/= (cdr (assoc '0 sube)) "SEQEND")
	 )
   (if (eq (strcase (cdr (assoc '2 sube))) (strcase tag))
    (setq value (cdr (assoc '1 sube)))
   )
   (setq subent (entnext subent) sube (entget subent)) 
  ); while
   
  value 
 ); get_attrib_value


 (defun draw_text (item0 item1 item2 j i text / pt)
  (if (setq pt (getpoint (strcat "\n" (car item0) ":" (nth j TAGSNAME) " #" (itoa i) "/" (itoa (length item1)) " &amp;lt;Pick point&amp;gt;: "))) 
   (command "._text" "_j" "_l" pt 2 0 text)
  )
 ); draw_text
  
  
 ; here start c:W1
 (setvar 'cmdecho 0)
 (command "._undo" "_begin")
 
 (setq savCLayer (getvar 'clayer))
 (command "._layer" "_M" "WIRE RUN-1" "")

 (setq TAGSNAME '("tension_length" "location_num" "chainage")) 
  
 (if (setq ss (ssget '((0 . "insert") (66 . 1))))
  (progn
   (mapcar
    '(lambda (ename)
      (setq AcDbBlkRef (vlax-ename-&amp;gt;vla-object ename))
      (if (eq (strcase (vla-get-effectiveName AcDbBlkRef)) "TENSION_LENGTH")
       (progn 
        (setq lst (block_attrib_list ename))
	(setq data^ (build_data_list))
       ); progn
      ); if  
      (vlax-release-object AcDbBlkRef) 
     ); lambda
    (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))  
   ); mapcar

   ; insert attributes value as text
   (foreach item0 data^
    (setq i 0)
    (foreach item1 (cdr item0)
     (setq j 0 i (1+ i)) 
     (foreach item2 item1
      (draw_text item0 item1 item2 (setq j (tag-spiner (1+ j))) i item2)
     ); foreach
    ); foreach

    (setq i 0) 
    (foreach item1 (cdr item0)
     (draw_text item0 item1 nil 0 (setq i (1+ i)) (car item0))
    ); foreach
   ); foreach
   
  ); progn
 ); if
  
 (setvar 'clayer savCLayer)
 (command "._undo" "end")
 (setvar 'cmdecho 1)
  
 (princ) 
)

 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Apr 2020 19:18:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9436799#M75987</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-11T19:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437172#M75988</link>
      <description>&lt;P&gt;Moshe-A re how many columns required had the same problem in a task playing with various blocks up to 25 attributes, so made a list of the atts ((blk1 2 3 4)(blk2 1 2 3 4 5 6 )(………… so just looked at the length of each individual list and this gave the number of columns required&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 02:39:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437172#M75988</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2020-04-12T02:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437390#M75989</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3747317"&gt;@jaggisingh003&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;found a bug, here is the fix&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 08:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437390#M75989</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-12T08:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437415#M75990</link>
      <description>&lt;P&gt;&lt;SPAN&gt;found a bug, here is the fix.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt;&amp;nbsp;you are so good that you can&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;found a bug in this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but here I can't even understand the code properly so in future I can do something like that other attributes blocks.&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":persevering_face:"&gt;😣&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 08:58:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437415#M75990</guid>
      <dc:creator>jaggisingh003</dc:creator>
      <dc:date>2020-04-12T08:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: block match a specific value by which two-block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437429#M75991</link>
      <description>&lt;P&gt;it's&amp;nbsp;totally&amp;nbsp;&lt;SPAN&gt;obvious,&lt;/SPAN&gt; you are only a beginner.&amp;nbsp; as long as you keep trying &lt;SPAN&gt;eventually you will catch it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;success will come in 'sweat'&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 09:31:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-match-a-specific-value-by-which-two-block/m-p/9437429#M75991</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2020-04-12T09:31:48Z</dc:date>
    </item>
  </channel>
</rss>

