<?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: Convert text into an attribute and import it to a block via a LISP routine in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10151321#M63082</link>
    <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a command MT2BL to integrate a mtext into block&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; but it has it's conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to define the block with one attribute and what that means?&lt;/P&gt;&lt;P&gt;say you have a block symbol (like in your pic) open it in bedit and add a tag attribute with what ever tag name you choose and place it on base point 0,0,0. set a reasonable height and angle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run MT2BL command:&lt;/P&gt;&lt;P&gt;it start by echoing select object(s) ... you select the block + the text\mtext in one shoot. the function filter your selection so you can choose only 2 objects a block and a text but you'll be alerted if you fail meaning selecting 2 texts or 2 blocks is forbidden.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you can understand MT2BL does not care about the block name or the attribute tag name all it cares is the block&amp;nbsp; contains only one attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your selection will be replaces by a new insert&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;MT2BL copies these properties from the mtext to the attribute:&lt;/P&gt;&lt;P&gt;layer, text style, height, angle and of course the position.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a minor inaccuracy in attribute position may occur due to a &lt;SPAN&gt;difference&lt;/SPAN&gt;&amp;nbsp;in text alignment.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; integrate mtext into block
(defun c:mt2bl (/ count_attdef _dxfCode textCentroid textBottomLeft ; local functions
                  ss elist0 elist1 elist2 tmp bname n)

 ; return number of attributes definition in block 
 (defun count_attdef (elist / ctr)
  (setq bname (cdr (assoc '2 elist)))

  (setq ctr 0) 
  (vlax-for AcDbEntity (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) bname)
   (if (eq (vla-get-objectName AcDbEntity) "AcDbAttributeDefinition")  
    (setq ctr (1+ ctr))
   )

   (vlax-release-object AcDbEntity) 
  ); vlax-for

  ctr
 ); count_attdef

  
 ; annonymous function 
 (setq _dxfCode (lambda (c e) (cdr (assoc c e))))

  
 (defun textCentroid (elist / AcDbEntity MinPoint MaxPoint)
  (setq AcDbEntity (vlax-ename-&amp;gt;vla-object (cdar elist)))
  (vla-getboundingBox AcDbEntity 'MinPoint 'MaxPoint)
  (vlax-release-object AcDbEntity)
   
  (setq pt (mapcar '(lambda (x0 x1) (/ (+ x0 x1) 2)) (vlax-safearray-&amp;gt;list MinPoint) (vlax-safearray-&amp;gt;list MaxPoint)))
 ); mtextCentroid


 (defun textBottomLeft (elist / AcDbEntity MinPoint MaxPoint)
  (setq AcDbEntity (vlax-ename-&amp;gt;vla-object (cdar elist)))
  (vla-getboundingBox AcDbEntity 'MinPoint 'MaxPoint)
  (vlax-release-object AcDbEntity)

  (vlax-safearray-&amp;gt;list MinPoint)
 ); textBottomLeft 

  
 ; here start c:mt2bl
 (setvar "cmdecho" 0)
 (command "._undo" "_begin")

 (setq savAttdia (getvar "attdia"))
 (setq savAttreq (getvar "attreq"))

 (setvar "attdia" 0)
 (setvar "attreq" 1)
  
 (cond
  ((not (setq ss (ssget '((0 . "insert,text,mtext"))))) ; select an insert and a text\mtext
  ); case
  ((&amp;lt; (sslength ss) 2)
   (vlr-beep-reaction)
   (prompt "\ntoo few objects selected.") 
  ); case
  ((&amp;gt; (sslength ss) 2)
   (vlr-beep-reaction)
   (prompt "\ntoo many objects selected.") 
  ); case
  ((not
     (or
       (and
           (wcmatch (cdr (assoc '0 (setq elist0 (entget (ssname ss 0))))) "INSERT")
           (wcmatch (cdr (assoc '0 (setq elist1 (entget (ssname ss 1))))) "TEXT,MTEXT")
       )  
       (and
           (wcmatch (cdr (assoc '0 (setq elist1 (entget (ssname ss 1))))) "INSERT")
           (wcmatch (cdr (assoc '0 (setq elist0 (entget (ssname ss 0))))) "TEXT,MTEXT")
       )
     ); or
   ); not
   (vlr-beep-reaction)
   (prompt "\nrequire 1 insert and 1 text.") 
  ); case
  ( t
   (if (eq (cdr (assoc '0 elist1)) "INSERT")
    (setq tmp elist0 elist0 elist1 elist1 tmp)
   )

   (setq n (count_attdef elist0))
   (cond    
    ((= n 0)
     (vlr-beep-reaction)
     (prompt "\nblock selected has no attributes.") 
    ) 
    ((&amp;gt; n 1)
     (vlr-beep-reaction)
     (prompt "\nblock selected has too many attributes.") 
    ) 
    ( t
     (command "._insert" bname (trans (_dxfCode 10 elist0) 0 1) "xyz" (_dxfCode 41 elist0) (_dxfCode 42 elist0)
              			      (_dxfCode 43 elist0) (angtos (_dxfCode 50 elist0) 0) (cdr (assoc '1 elist1)))
     (setq elist2 (entget (entnext (entlast))))
     
     (setq elist2 (subst (cons  '8 (_dxfCode  8 elist1)) (assoc  '8 elist2) elist2)) ; set layer
     (setq elist2 (subst (cons  '7 (_dxfCode  7 elist1)) (assoc  '7 elist2) elist2)) ; set text style 
     (setq elist2 (subst (cons '40 (_dxfCode 40 elist1)) (assoc '40 elist2) elist2)) ; set height
     (setq elist2 (subst (cons '50 (_dxfCode 50 elist1)) (assoc '50 elist2) elist2)) ; set angle
     
     (cond
      ((or
         (not (cdr (assoc '11 elist2)))
         (equal (cdr (assoc '11 elist2)) '(0.0 0.0 0.0))
       )
       (entmod (subst (cons '10 (textBottomLeft elist1)) (assoc '10 elist2) elist2)) ; position attribute by dxf10
      )
      ( t
       (entmod (subst (cons '11 (textCentroid elist1)) (assoc '11 elist2) elist2))   ; position attribute by dxf11
      ) 
     ); cond

     (entdel (cdar elist0))
     (entdel (cdar elist1))
    ); case
   ); cond
  ); case
 ); cond

 (setvar "attdia" savAttdia)
 (setvar "attreq" savAttreq)
  
 (command "._undo" "_end")
 (setvar "cmdecho" 1)
 (princ)
); c:mt2bl&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2021 12:12:14 GMT</pubDate>
    <dc:creator>Moshe-A</dc:creator>
    <dc:date>2021-03-12T12:12:14Z</dc:date>
    <item>
      <title>Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10149004#M63079</link>
      <description>&lt;P&gt;Good evening everyone...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue and I think LISP could help me....it is my last hope to save hours of work time.....&lt;/P&gt;&lt;P&gt;A company has handed over various drawings that contain blocks but the information related to the blocks is written either in text or mtext format... So when I try to extract the data so that I can handle it in a csv file I have absolutely no connection between the text and the block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is run a lisp that can select the text which is closest to a block (with proximity or relative distance criteria), convert it to an attribute and then integrate it to that block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this even possible?&lt;/P&gt;&lt;P&gt;In an attempt to make it more clear, I have attached a screenshot. Currently I have block "X" with no information and some adjacent text (REC22). I want the lisp to integrade the REC22 text to block with a tag that can be predefined by me (i.e. DESC_1) and insert the text as an attribute value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 17:01:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10149004#M63079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-11T17:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10149023#M63080</link>
      <description>&lt;P&gt;If you don't find a solution or help to do it for free, I can help with this for the cost and time spent on it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 17:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10149023#M63080</guid>
      <dc:creator>JTBWorld</dc:creator>
      <dc:date>2021-03-11T17:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10150521#M63081</link>
      <description>&lt;P&gt;You can try &lt;A href="https://sites.google.com/site/cadkits/home/altext" target="_blank" rel="noopener"&gt;ALTEXT&lt;/A&gt;. It can use a customized formula to handle block attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Original texts and block inserts - texts are around block inserts:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altext_B1.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/892191iDFFAEEF7F805B769/image-size/large?v=v2&amp;amp;px=999" role="button" title="altext_B1.PNG" alt="altext_B1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Save the codes in Example 11 of ALTEXT Formula as a "lsp" file and load ALTEXT.vlx.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Ensure the block has an attribute. You can redefine the block and use BATTMAN if necessary.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 3&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Select one block and "Select similar" from the short-cut menu.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Step 4&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Run ALTEXT and tick the "Use formula" option. Select the lsp file saved in Step 1 as the formula.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altext_b2.PNG" style="width: 335px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/892190i6334207280BC2DE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="altext_b2.PNG" alt="altext_b2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altext_b3.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/892192i1E551BF74AD7EB28/image-size/large?v=v2&amp;amp;px=999" role="button" title="altext_b3.PNG" alt="altext_b3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 04:32:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10150521#M63081</guid>
      <dc:creator>3wood</dc:creator>
      <dc:date>2021-03-12T04:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10151321#M63082</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a command MT2BL to integrate a mtext into block&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; but it has it's conditions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to define the block with one attribute and what that means?&lt;/P&gt;&lt;P&gt;say you have a block symbol (like in your pic) open it in bedit and add a tag attribute with what ever tag name you choose and place it on base point 0,0,0. set a reasonable height and angle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run MT2BL command:&lt;/P&gt;&lt;P&gt;it start by echoing select object(s) ... you select the block + the text\mtext in one shoot. the function filter your selection so you can choose only 2 objects a block and a text but you'll be alerted if you fail meaning selecting 2 texts or 2 blocks is forbidden.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you can understand MT2BL does not care about the block name or the attribute tag name all it cares is the block&amp;nbsp; contains only one attribute.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your selection will be replaces by a new insert&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;MT2BL copies these properties from the mtext to the attribute:&lt;/P&gt;&lt;P&gt;layer, text style, height, angle and of course the position.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a minor inaccuracy in attribute position may occur due to a &lt;SPAN&gt;difference&lt;/SPAN&gt;&amp;nbsp;in text alignment.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; integrate mtext into block
(defun c:mt2bl (/ count_attdef _dxfCode textCentroid textBottomLeft ; local functions
                  ss elist0 elist1 elist2 tmp bname n)

 ; return number of attributes definition in block 
 (defun count_attdef (elist / ctr)
  (setq bname (cdr (assoc '2 elist)))

  (setq ctr 0) 
  (vlax-for AcDbEntity (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) bname)
   (if (eq (vla-get-objectName AcDbEntity) "AcDbAttributeDefinition")  
    (setq ctr (1+ ctr))
   )

   (vlax-release-object AcDbEntity) 
  ); vlax-for

  ctr
 ); count_attdef

  
 ; annonymous function 
 (setq _dxfCode (lambda (c e) (cdr (assoc c e))))

  
 (defun textCentroid (elist / AcDbEntity MinPoint MaxPoint)
  (setq AcDbEntity (vlax-ename-&amp;gt;vla-object (cdar elist)))
  (vla-getboundingBox AcDbEntity 'MinPoint 'MaxPoint)
  (vlax-release-object AcDbEntity)
   
  (setq pt (mapcar '(lambda (x0 x1) (/ (+ x0 x1) 2)) (vlax-safearray-&amp;gt;list MinPoint) (vlax-safearray-&amp;gt;list MaxPoint)))
 ); mtextCentroid


 (defun textBottomLeft (elist / AcDbEntity MinPoint MaxPoint)
  (setq AcDbEntity (vlax-ename-&amp;gt;vla-object (cdar elist)))
  (vla-getboundingBox AcDbEntity 'MinPoint 'MaxPoint)
  (vlax-release-object AcDbEntity)

  (vlax-safearray-&amp;gt;list MinPoint)
 ); textBottomLeft 

  
 ; here start c:mt2bl
 (setvar "cmdecho" 0)
 (command "._undo" "_begin")

 (setq savAttdia (getvar "attdia"))
 (setq savAttreq (getvar "attreq"))

 (setvar "attdia" 0)
 (setvar "attreq" 1)
  
 (cond
  ((not (setq ss (ssget '((0 . "insert,text,mtext"))))) ; select an insert and a text\mtext
  ); case
  ((&amp;lt; (sslength ss) 2)
   (vlr-beep-reaction)
   (prompt "\ntoo few objects selected.") 
  ); case
  ((&amp;gt; (sslength ss) 2)
   (vlr-beep-reaction)
   (prompt "\ntoo many objects selected.") 
  ); case
  ((not
     (or
       (and
           (wcmatch (cdr (assoc '0 (setq elist0 (entget (ssname ss 0))))) "INSERT")
           (wcmatch (cdr (assoc '0 (setq elist1 (entget (ssname ss 1))))) "TEXT,MTEXT")
       )  
       (and
           (wcmatch (cdr (assoc '0 (setq elist1 (entget (ssname ss 1))))) "INSERT")
           (wcmatch (cdr (assoc '0 (setq elist0 (entget (ssname ss 0))))) "TEXT,MTEXT")
       )
     ); or
   ); not
   (vlr-beep-reaction)
   (prompt "\nrequire 1 insert and 1 text.") 
  ); case
  ( t
   (if (eq (cdr (assoc '0 elist1)) "INSERT")
    (setq tmp elist0 elist0 elist1 elist1 tmp)
   )

   (setq n (count_attdef elist0))
   (cond    
    ((= n 0)
     (vlr-beep-reaction)
     (prompt "\nblock selected has no attributes.") 
    ) 
    ((&amp;gt; n 1)
     (vlr-beep-reaction)
     (prompt "\nblock selected has too many attributes.") 
    ) 
    ( t
     (command "._insert" bname (trans (_dxfCode 10 elist0) 0 1) "xyz" (_dxfCode 41 elist0) (_dxfCode 42 elist0)
              			      (_dxfCode 43 elist0) (angtos (_dxfCode 50 elist0) 0) (cdr (assoc '1 elist1)))
     (setq elist2 (entget (entnext (entlast))))
     
     (setq elist2 (subst (cons  '8 (_dxfCode  8 elist1)) (assoc  '8 elist2) elist2)) ; set layer
     (setq elist2 (subst (cons  '7 (_dxfCode  7 elist1)) (assoc  '7 elist2) elist2)) ; set text style 
     (setq elist2 (subst (cons '40 (_dxfCode 40 elist1)) (assoc '40 elist2) elist2)) ; set height
     (setq elist2 (subst (cons '50 (_dxfCode 50 elist1)) (assoc '50 elist2) elist2)) ; set angle
     
     (cond
      ((or
         (not (cdr (assoc '11 elist2)))
         (equal (cdr (assoc '11 elist2)) '(0.0 0.0 0.0))
       )
       (entmod (subst (cons '10 (textBottomLeft elist1)) (assoc '10 elist2) elist2)) ; position attribute by dxf10
      )
      ( t
       (entmod (subst (cons '11 (textCentroid elist1)) (assoc '11 elist2) elist2))   ; position attribute by dxf11
      ) 
     ); cond

     (entdel (cdar elist0))
     (entdel (cdar elist1))
    ); case
   ); cond
  ); case
 ); cond

 (setvar "attdia" savAttdia)
 (setvar "attreq" savAttreq)
  
 (command "._undo" "_end")
 (setvar "cmdecho" 1)
 (princ)
); c:mt2bl&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 12:12:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10151321#M63082</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2021-03-12T12:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10151580#M63083</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;.... drawings that contain blocks but the information related to the blocks is written either in text or mtext format..&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The big question in my mind is whether those rectangles in your image are multiple Insertions of the &lt;EM&gt;same Block name&lt;/EM&gt;.&amp;nbsp; [We can't tell from an image.]&amp;nbsp; If so, then I suspect you &lt;EM&gt;don't&lt;/EM&gt; want to take a nearby piece of Text/Mtext, convert it to an Attribute, and integrate it into the Block, because after that has happened once, the next one will be adding a &lt;EM&gt;second&lt;/EM&gt; Attribute into the same Blockdefinition, and the next one a &lt;EM&gt;third&lt;/EM&gt;, etc.&amp;nbsp; That concern argues for something like&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/540432"&gt;@3wood&lt;/a&gt;'s suggestion to give the Block an Attribute [&lt;EM&gt;one&lt;/EM&gt; time], and let the process be to take the text &lt;EM&gt;content&lt;/EM&gt; from the nearby Text/Mtext object, and assign that to the Attribute that's already in the Block.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 13:47:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10151580#M63083</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2021-03-12T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10152011#M63084</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fine tuning ... put the whole process in a loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 16:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10152011#M63084</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2021-03-12T16:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10156834#M63085</link>
      <description>&lt;P&gt;Good morning&amp;nbsp; everyone,&lt;/P&gt;&lt;P&gt;Thank you for your responses.&lt;/P&gt;&lt;P&gt;Unfortunately it is not an option for me to install third party software without the approval of our IT department.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Indeed these rectangles have multiple insertions in a drawing. However they do not have the same text. They might have a different - or the same depending on the case - text (Left side of the attached image...Text 1/2/..../6).&lt;/P&gt;&lt;P&gt;What I want is to convert the text to a single attribute with different content and insert it to the nearest block. The attribute location within the drawing shall remain the same as the text.&lt;/P&gt;&lt;P&gt;I don't mind if the block has to be renamed for the conversion as long as the new name is not a temp one or a unique one (i need to use the QSELECT command for counting them). For example if I had a block named RECT and it was repeated 20 times with 20 different adjacent texts, after running the lisp I would still want a block (don't mind if it is named RECT or RECT_B) repeated 20 times&amp;nbsp; with a single attribute tag and 20 different values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the case I cannot retain the original block name (RECT) I would like to have the option to set the new name myself.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 08:46:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10156834#M63085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T08:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10156902#M63086</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;- Is the target block already have an attribute defiintion&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;--- YES&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;------ is it on the same spot as text or anywhere near it?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;--- NO: Do you already have a the block attribute for replacement?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;------ YES: Use Express Tool "BLOCKREPLACE"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;------ NO:Do you want to inherit the TEXT properties?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;---------&amp;nbsp; YES:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;---------&amp;nbsp; NO: Please specify height. style etc...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;More importantly&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Would it be possible to post a sample drawing file and not just an image?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 09:21:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10156902#M63086</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-15T09:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157105#M63087</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to upload a sample file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The blocks don't have defined attributes at the moment.&lt;/P&gt;&lt;P&gt;I don't have a block attribute ready for replacement.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I want to inherit the text properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Keep in mind, I already have 20-30 defined blocks without attributes. So I want to apply this action to all of them. I also want to minimize manual labor, to reduce the possibilities of mistakes. I want the lisp to do a quick "scan" find the available block names and perform the action automatically. Take the text, inherit the properties and location of text to apply it to the attribute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:44:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157105#M63087</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T10:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157695#M63088</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to upload a sample file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The blocks don't have defined attributes at the moment.&lt;/P&gt;
&lt;P&gt;I don't have a block attribute ready for replacement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes I want to inherit the text properties.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:Text2AttB (/ ss i TheSelectedTextObject ll ur blk l sstext dataFromSelectedBlockObject
	       		dataIneedFromSelectedBlockObject entText)
  (if (and
	(setq ss (ssget "_:L" '((0 . "INSERT"))))
	(setq fuzz (getreal "\nEnter Fuzz factor: "))
	)
	
	    (repeat (setq i (sslength ss))
	      (setq blk (ssname ss (setq i (1- i))))	    
	      (setq dataFromSelectedBlockObject (entget blk))
	      (setq dataIneedFromSelectedBlockObject
		     (mapcar
		       (function
			 (lambda (dxfcodes)
			   (assoc
			     dxfcodes
			     dataFromSelectedBlockObject
			   )
			 )
		       )
		       '( 2 8 10 50 41 42 43 50 )
		     )
	      )
	      (Vla-getboundingbox (vlax-ename-&amp;gt;vla-object blk) 'll 'ur)
	      (setq ll (vlax-safearray-&amp;gt;list ll)
		    ur (vlax-safearray-&amp;gt;list ur) cnt 0)
	      
		(While  (and (&amp;lt; cnt 10)
			 (not (setq sstext (ssget "C"  ll ur '((0 . "TEXT"))))))
			(setq ur (polar ur (* pi 0.25) (* fuzz (sqrt 2)))
			      ll (polar ll (* pi 1.25) (* fuzz (sqrt 2))) cnt (1+ cnt))
		  )
	      
	      (if
		sstext
		(progn
		  (setq entText (entget (ssname sstext 0)))
		  (setq dataIneedFromSelectedTextObject
			     (mapcar
			       (function
				 (lambda (dxfcodes)
				   (assoc
				     dxfcodes
				     entText
				   )
				 )
			       )
			       '(1 40 7 10 50 41 8)
			     )
		        )
		  (entmake
			(append
			  (list	'(0 . "INSERT") '(66 . 1))
			  	dataIneedFromSelectedBlockObject )
		      	)
		      (entmake
			(append
			  (list '(0 . "ATTRIB")
			    '(2 . "TAG")
			    '(70 . 0)
			  )
			  (cons '(1 . "-") (Cdr dataIneedFromSelectedTextObject))
			)
		      )
	      (entmake '((0 . "SEQEND")))
	      (entdel (ssname sstext 0))
		  
		(Vla-put-textstring
			  (car (vlax-invoke
			    (vlax-ename-&amp;gt;vla-object (entlast))
			    'GetAttributes
			  )
		       )
		  (Cdr (Car dataIneedFromSelectedTextObject))
		)
	    )
	  )
	)
    )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tested this on the drawing sample, a fuzz factor of 10. missed 3 items, 20 missed 1, and 30 is just right.&lt;/P&gt;
&lt;P&gt;So it really depends on how far the TEXT.&amp;nbsp; you should be able to play with fuzz value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 14:25:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157695#M63088</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-15T14:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157827#M63089</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OMG... I am speechless! I am so grateful!!!&lt;/P&gt;&lt;P&gt;It works like a charm. It retains the block name. The attribute retains the former text layer within the Enhanced Attribute Editor....It is perfect.&lt;/P&gt;&lt;P&gt;I am losing like 10-20 texts out of 400 simply out of geographical constrains but I can manually edit them. Just for you to understand, I created a block named M which contains two texts (REC100, REC200) in the vicinity of the block. Your LISP incorporates only REC100 as an attribute and leaves out REC200 (it should be a second attribute). These are the 10-20 texts I am missing...but its ok I can do it manually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing :&lt;/P&gt;&lt;P&gt;Is there a way to export all these blocks in a csv list file that will contain the following columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Block Name │ Handle │ Insertion_Point_Coordinates(X_Y_Z)&amp;nbsp;│Rotation Angle │Attribute_TAG1 │Value_TAG1 │Attribute_TAG3 │&amp;nbsp;Value_TAG2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:11:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157827#M63089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T15:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157937#M63090</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.... Your LISP incorporates only REC100 as an attribute and leaves out REC200 (it should be a second attribute). These are the 10-20 texts I am missing...but its ok I can do it manually.,,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:Text2AttB (/ ss i TheSelectedTextObject ll ur blk l sstext dataFromSelectedBlockObject
	       		dataIneedFromSelectedBlockObject entText)
  (if (and
	(setq ss (ssget "_:L" '((0 . "INSERT"))))
	(setq fuzz (getreal "\nEnter Fuzz factor: "))
	)
	
	    (repeat (setq i (sslength ss))
	      (setq blk (ssname ss (setq i (1- i))))	    
	      (setq dataFromSelectedBlockObject (entget blk))
	      (setq dataIneedFromSelectedBlockObject
		     (mapcar
		       (function
			 (lambda (dxfcodes)
			   (assoc
			     dxfcodes
			     dataFromSelectedBlockObject
			   )
			 )
		       )
		       '( 2 8 10 50 41 42 43 50 )
		     )
	      )
	      (Vla-getboundingbox (vlax-ename-&amp;gt;vla-object blk) 'll 'ur)
	      (setq str nil
		     ll (vlax-safearray-&amp;gt;list ll)
		    ur (vlax-safearray-&amp;gt;list ur) cnt 0)
	      
		(While  (and (&amp;lt; cnt 10)
			 (not (setq sstext (ssget "C"  ll ur '((0 . "TEXT"))))))
			(setq ur (polar ur (* pi 0.25) (* fuzz (sqrt 2)))
			      ll (polar ll (* pi 1.25) (* fuzz (sqrt 2))) cnt (1+ cnt))
		  )
	      
	      (if
		sstext
		(progn
		  (entmake
			(append
			  (list	'(0 . "INSERT") '(66 . 1))
			  	dataIneedFromSelectedBlockObject )
		      	)
		  (repeat (Setq n (sslength sstext))
			(setq entText (entget (ssname sstext (setq n (1- n)))))
			  (setq dataIneedFromSelectedTextObject
				     (mapcar
				       (function
					 (lambda (dxfcodes)
					   (assoc
					     dxfcodes
					     entText
					   )
					 )
				       )
				       '(1 40 7 10 50 41 8)
				     )
			        )
		      (setq str (cons (cdr (car dataIneedFromSelectedTextObject)) str))
		      (entmake
			(append
			  (list '(0 . "ATTRIB")
			    (cons 2  (Strcat "TAG" (itoa (1+ n))))
			    '(70 . 0)
			  )
			  (cons '(1 . "-") (Cdr dataIneedFromSelectedTextObject))
			)
		      )
		    (entdel (ssname sstext n))		    
		    )
	      (entmake '((0 . "SEQEND")))
		  (mapcar 'vla-put-textstring
			  (vlax-invoke (vlax-ename-&amp;gt;vla-object (entlast))
			    'GetAttributes
			  )
				(reverse str))
	    )
	  )
	)
    )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;One more thing :&lt;/P&gt;
&lt;P&gt;Is there a way to export all these blocks in a csv list file that will contain the following columns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Block Name │ Handle │ Insertion_Point_Coordinates(X_Y_Z)&amp;nbsp;│Rotation Angle │Attribute_TAG1 │Value_TAG1 │Attribute_TAG3 │&amp;nbsp;Value_TAG2&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try DATAEXTRACTION, if that doesnt work for you, the come back and we will sort it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10157937#M63090</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-15T15:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10158101#M63091</link>
      <description>&lt;P&gt;Correct me if I am wrong, but DATAEXTRACTION does not give me the hexadecimal unique handle of the items and I need it as a unique identifier of items...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:47:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10158101#M63091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-15T16:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10166287#M63092</link>
      <description>&lt;LI-CODE lang="lisp"&gt;(defun c:GiveMeYourData ( / _sort addtolist _concatenate opf ss csvFile e data atrb AllData)
(defun _concatenate (lst)
	(apply 'strcat (mapcar '(lambda (st)
					     (strcat  st ",")) lst ))
  )  
(Defun _sort (s l) (vl-sort l '(lambda (a b)(&amp;lt; (s a)(s b)))))
(defun addtolist ( key val lst / old )
    (if (setq old (assoc key lst))
        (subst (append old (list val)) old lst)
        (cons  (list key val) lst)
    )
) 
  (if (And
	(setq ss (ssget "_X" '((0 . "INSERT")(66 . 1))))
	(setq csvFile (getfiled "Output File" "" "csv" 1))
	)
  	(progn
	  (repeat (setq i (sslength ss))
	    	(setq e (vlax-ename-&amp;gt;vla-object (ssname ss (setq i (1- i)))))
	    	(setq data (mapcar '(lambda (p)(vlax-get e p))
		       '("EffectiveName" "Handle" "InsertionPoint" "Rotation"))
		       atrb (_sort car (mapcar '(lambda (at)
						  (list (vla-get-tagstring at)(vla-get-textstring at)))
				    (vlax-invoke e 'GetAttributes)))
		       )
	    	(setq AllData (addtolist (car data) (append (Cdr data) atrb) AllData))
	    )
	  (setq opf (open csvFile "w"))
	  (setq AllData (_sort car AllData))
	  (while (setq a (car AllData))
	    	 (Foreach itm (cdr a)
		   (write-line
			   (_concatenate
			      (apply 'append 			     
				     (list
				       (list (car a)(car itm))
					   (mapcar 'rtos (Cadr itm))
					   (list (rtos (/ (* (Caddr itm) 180.0) pi) 2 0))
					   (apply 'append (cdddr itm))
					   )
				     ) 
			      )
			   opf
			   )
		   )
	    (setq AllData (cdr AllData))
	    )
	    (Close opf)
	    (startapp "explorer" csvFile)
	    )
	  )(princ)
	)&lt;/LI-CODE&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 07:06:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10166287#M63092</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-03-18T07:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10176490#M63093</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the LISP and it almost runs perfectly. THANK YOU SO MUCH.&lt;/P&gt;&lt;P&gt;I have one tiny remark and I don't know if we can solve it via the lisp or if it has to be done via VBA in excel...&lt;/P&gt;&lt;P&gt;Let me try to describe the issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your LISP returns the attribute values in the following format:&lt;/P&gt;&lt;P&gt;Block Name_Handle_X_Y_Z_Rotation_AttTag1_AttValue1_AttTag2_AttValue2_AttTag3_AttValue3....&lt;/P&gt;&lt;P&gt;Some different blocks share some common AttTags but in a different BATTORDER.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To give you an example, lets assume that I have a block named "Ball" and another one named "Shoe". I run your LISP and it returns the following csv:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ball&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;F7D16&amp;nbsp; &amp;nbsp;500.235&amp;nbsp; &amp;nbsp;100.235&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;0&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;STRONG&gt;90&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;COLOUR&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RED&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;DIAMETER&amp;nbsp;&lt;STRONG&gt;10CM&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;AIRPRESSURE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;1ATM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Shoe&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FC1F6&amp;nbsp; &amp;nbsp;328.235&amp;nbsp; &amp;nbsp; 198.235&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;90&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;SIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;BRAND&amp;nbsp;&lt;STRONG&gt;NIKE&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;COLOUR&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;GREEN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to put&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;all identical Attribute Tags (contained in different blocks)&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the same column ? That would mean that my sample case would return the following results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ball&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;F7D16&amp;nbsp; &amp;nbsp;500.235&amp;nbsp; &amp;nbsp;100.235&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;0&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;STRONG&gt;90&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;COLOUR&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;RED&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;DIAMETER&amp;nbsp;&lt;STRONG&gt;10CM&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;AIRPRESSURE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;1ATM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Shoe&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FC1F6&amp;nbsp; &amp;nbsp;328.235&amp;nbsp; &amp;nbsp; 198.235&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;90&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;COLOUR&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;GREEN&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;SIZE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;BRAND&amp;nbsp;&lt;STRONG&gt;NIKE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.. I appreciate it greatly.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 15:49:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10176490#M63093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-22T15:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10267902#M63094</link>
      <description>&lt;P&gt;Good morning &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;I used your lisp quite a lot and thank you about it.. I noticed a small glitch though.&lt;/P&gt;&lt;P&gt;If a block does not contain any attributes, it is not recorded in the excel spreadsheet. Could it be possible to find a workaround that includes these kinds of blocks and just leave the attribute fields blank apart from the ones that are already recorded that contain attributes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Dgoutz&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 06:51:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/10267902#M63094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-26T06:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12654068#M63095</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;,&lt;BR /&gt;so far this lisp is the closest i have gotten to what i need. I just posted my question yesterday, but i decided to keep searching the forum. my starting point is multiple pairs of objects (a TEXT and a POINT). they are pretty close to one another. i use another lisp to get these pairs to a place where i can use the lisp you wrote here. The other lisp replaces all my POINTS with a block I select. the block i am using has just one defined attribute. At this point i can use your lisp and it creates a copy of the block with the text in the attribute value!!!&lt;BR /&gt;How can i get it so that it doesnt copy the blocks and instead modifies the blocks i selected?&lt;BR /&gt;&lt;BR /&gt;Even better still, it would be great to have just one lisp that would replace all my selected text objects with the block i choose and also use the TEXT as the value for the one attribute that the block is defined with. the blocks insertion point would need to go to the TEXT objects "justify" point location.</description>
      <pubDate>Wed, 20 Mar 2024 17:12:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12654068#M63095</guid>
      <dc:creator>nbortolussi</dc:creator>
      <dc:date>2024-03-20T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12654960#M63096</link>
      <description>&lt;P&gt;It would have been better to just post the link to here in your other post, so where is it ? Need a sample dwg.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 02:07:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12654960#M63096</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-03-21T02:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12655075#M63097</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3200740"&gt;@nbortolussi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;How can i get it so that it doesnt copy the blocks and instead modifies the blocks i selected?&lt;BR /&gt;...&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Definitely doable&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3200740"&gt;@nbortolussi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;so far this lisp is the closest i have gotten to what i need. I just posted my question yesterday,&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;You're referring to this post?&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-multiple-point-objects-with-block-and-add-nearest-text/m-p/12654794#M463600" target="_blank" rel="noopener"&gt;replace multiple point objects with block and add nearest text as block attribute&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 03:52:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12655075#M63097</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2024-03-21T03:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text into an attribute and import it to a block via a LISP routine</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12656350#M63098</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;,&lt;BR /&gt;yes, that was my post, and it was just solved. thank you for your consideration.</description>
      <pubDate>Thu, 21 Mar 2024 14:13:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-text-into-an-attribute-and-import-it-to-a-block-via-a/m-p/12656350#M63098</guid>
      <dc:creator>nbortolussi</dc:creator>
      <dc:date>2024-03-21T14:13:25Z</dc:date>
    </item>
  </channel>
</rss>

