<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LISP to recognize mtext from cad to excel in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10852453#M51099</link>
    <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;TRY&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(defun c:EL (/ CELL FILENAME I ICOL INS1 IROW IROWS RNG SSET XLAPP XLBOOK XLCELL XLFRANGE XLRANGE XLRANGEC XLSHEET)
  (vl-load-com)
 (setq dic (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))

(mapcar 'setvar svnames '(0 0)); turn off Osnap, command echoing
(command "_.layer" "_make" "0S-EL" "_color" 7 "" "p"  "N" "" "");; &amp;lt;---EDIT Layer name/color as desired
(setq styht (cdr (assoc 40 (tblsearch "style" (getvar 'dimtxsty))))); height of text style in current dimension style
(if (= styht 0.0) (setq styht (* (getvar 'dimtxt) (getvar 'dimscale)))); if above is non-fixed-height
 
  
  (if (AND
	(setq sset (ssget '((-4 . "&amp;lt;OR") (0 . "MTEXT") (0 . "TEXT") (-4 . "OR&amp;gt;"))))
	(setq fileName (getfiled "Select Excel file to find cell address :" (getvar "dwgprefix") "xlsx;xls" 16))
	
	)
    (progn
      (setq xlApp (vlax-create-object "Excel.Application"))
	(vlax-put-property xlApp "Visible" :vlax-true)
	(setq xlBook (vlax-invoke-method (vlax-get-property xlApp 'WorkBooks) "Open" fileName ) )
	(vlax-invoke-method xlBook "Activate")
	(setq xlSheet (vlax-get-property (vlax-get-property xlBook "WorkSheets") "Item" 1) )

	(setq xlRangeC (vlax-invoke-method xlSheet "Activate") )
	 (setq xlRange (vlax-get-property xlSheet "Range" "A1:A1000"))
	  (vlax-invoke-method xlRange "Select")
         (setq iCol (vlax-get-property xlRange "Column"))
	(setq iRows (vlax-get-property(vlax-get-property xlRange "Rows") "Count" )iRow  (vlax-get-property xlRange "Row") )
	(setq rng (vlax-get-property xlApp 'Cells))

      
      (setq i 0)
      (repeat (sslength sset)

	(setq xlCell (vlax-invoke-method
      xlRange
      "Find"
      (vlax-make-variant (vla-get-TEXTSTRING (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
      xlFRange
      -4163
      1
      1
      1
      nil
      nil
           )
     )
	

	(IF (/= nil xlCell)
	  
	(PROGN  

 (setq cell (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 5 (vlax-get-property xlCell "Column")) )     )  ) ;ç¬¬å¹¾åˆ—
(setq cell2 (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 6 (vlax-get-property xlCell "Column")) )     )  ) ;ç¬¬å¹¾åˆ—

 
)
	 
	  )

                     (setq ins1 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-insertionpoint (vlax-ename-&amp;gt;vla-object (ssname sset i))))))


(IF (= 0.0 (vla-get-ROTATION (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
  (PROGN    ;horizontal part
	

	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 0) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (+(CADR ins1) 35) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1 (IF (/= nil xlCell)
			     (strcat "TOP: " (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))
			     (strcat "TOP: NIL ")
			     )
			 ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )

    
(setq p1 (LIST  (+(CAR ins1)70) (+(CADR ins1) 40) (CADDR ins1))
p2 (LIST  (+(CAR ins1)160) (-(CADR ins1) 10) (CADDR ins1))
p3 (LIST  (+(CAR ins1)70) (+(CADR ins1) 15) (CADDR ins1))
p4 (LIST  (+(CAR ins1)160) (+(CADR ins1) 15) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")
	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 2) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (+(CADR ins1)10) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1  (IF (/= nil xlCell)
			 (strcat "BOT: " (RTOS (vlax-variant-value  (vlax-get-property cell2 'value2)) 2 2 ))
			      (strcat "BOT: NIL ")
			      )

			      ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
	)

  (PROGN    ;if not horizontal part

   (entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 0) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)20) (+(CADR ins1) 35) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1 (IF (/= nil xlCell)
			     (strcat "TOP: " (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))
			     (strcat "TOP: NIL ")
			     )
			 ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
(setq p1 (LIST  (+(CAR ins1)5) (+(CADR ins1) 40) (CADDR ins1))
p2 (LIST  (+(CAR ins1)95) (-(CADR ins1) 10) (CADDR ins1))
p3 (LIST  (+(CAR ins1)5) (+(CADR ins1) 15) (CADDR ins1))
p4 (LIST  (+(CAR ins1)95) (+(CADR ins1) 15) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")
	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 2) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)20) (+(CADR ins1)10) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1  (IF (/= nil xlCell)
			 (strcat "BOT: " (RTOS (vlax-variant-value  (vlax-get-property cell2 'value2)) 2 2 ))
			      (strcat "BOT: NIL ")
			      )

			      ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
    )
 )

        (setq i (1+ i))
      )
      
    )
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 314px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1006457iC02F75E73B310D07/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Jan 2022 10:56:29 GMT</pubDate>
    <dc:creator>hosneyalaa</dc:creator>
    <dc:date>2022-01-01T10:56:29Z</dc:date>
    <item>
      <title>LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10832873#M51085</link>
      <description>&lt;P&gt;Hello everyone, I have a requirement to window choosing the mtext from CAD file, then corresponding to the pre-established&amp;nbsp; excel .If mtext&amp;nbsp;correspond to the certain cell in excel&amp;nbsp; then show the corresponding value in CAD besides the mtext like the example&amp;nbsp; file below. Can someone give me some help or some hints . Thanks for&amp;nbsp; everyone's help.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 02:48:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10832873#M51085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-20T02:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10833544#M51086</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TRY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(defun c:QQQQQTEXTFIND (/ CELL FILENAME I ICOL INS1 IROW IROWS RNG SSET XLAPP XLBOOK XLCELL XLFRANGE XLRANGE XLRANGEC XLSHEET)
  (vl-load-com)
  
  
  (if (AND
	(setq sset (ssget '((-4 . "&amp;lt;OR") (0 . "MTEXT") (0 . "TEXT") (-4 . "OR&amp;gt;"))))
	(setq fileName (getfiled "Select Excel file to find cell address :" (getvar "dwgprefix") "xlsx;xls" 16))
	
	)
    (progn
      (setq xlApp (vlax-create-object "Excel.Application"))
	(vlax-put-property xlApp "Visible" :vlax-true)
	(setq xlBook (vlax-invoke-method (vlax-get-property xlApp 'WorkBooks) "Open" fileName ) )
	(vlax-invoke-method xlBook "Activate")
	(setq xlSheet (vlax-get-property (vlax-get-property xlBook "WorkSheets") "Item" 1) )

	(setq xlRangeC (vlax-invoke-method xlSheet "Activate") )
	 (setq xlRange (vlax-get-property xlSheet "Range" "A1:A1000"))
	  (vlax-invoke-method xlRange "Select")
         (setq iCol (vlax-get-property xlRange "Column"))
	(setq iRows (vlax-get-property(vlax-get-property xlRange "Rows") "Count" )iRow  (vlax-get-property xlRange "Row") )
	(setq rng (vlax-get-property xlApp 'Cells))

      
      (setq i 0)
      (repeat (sslength sset)
        
	(setq xlCell (vlax-invoke-method
      xlRange
      "Find"
      (vlax-make-variant (vla-get-TEXTSTRING (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
      xlFRange
      -4163
      1
      1
      1
      nil
      nil
           )
     )

 (setq cell (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 1 (vlax-get-property xlCell "Column")) )     )  )

                     (setq ins1 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-insertionpoint (vlax-ename-&amp;gt;vla-object (ssname sset i))))))
                    
	

	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0") '(62 . 2)
		   '(6 . "Continuous")
		   '(100 . "AcDbMText")
		   (cons 10  (LIST (+ 241 (CAR ins1)) (CADR ins1) (CADDR ins1) ))
		   '(40 . 100) '(41 . 1029.137964877809)
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1   (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))
		   '(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
	
        (setq i (1+ i))
      )
      
    )
  )
  (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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QQQQ131QQQ9.gif" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1003254i56B0AC916EC7A1A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="QQQQ131QQQ9.gif" alt="QQQQ131QQQ9.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 13:00:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10833544#M51086</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-20T13:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10834785#M51087</link>
      <description>&lt;P&gt;The lisp you write is great.I tried to realize your code and modify your code to be more suitable for my requirement.If I have some problem could you please help me to solve :)) By the way, thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 01:02:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10834785#M51087</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-21T01:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10835282#M51088</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;What is your problem?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 07:27:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10835282#M51088</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-21T07:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10838269#M51089</link>
      <description>&lt;P&gt;My final goal is like picture in explain.jpg.First, create excel and setting &amp;nbsp;A E F G H row's information by user then B C D row will be generate by excel if function, then the excel for autocad will be prepared.In autocad,I need to show every beam's and slab's e&lt;SPAN&gt;levation.Like&lt;/SPAN&gt;&amp;nbsp;picture in explain.jpg,red mark is mtext on dwg file originally, so I want to add green and purple mark using lisp to auto mark them, the data of green mark are B row in excel and the data of purple mark are C and D row.These two marks should be alone red mark like the pictures I show.Finally, this is my final goal.I think last time you help me to write the code to solve that problem,I think my requirement is not difficult to you, but I didn't know too much about AutoLisp.If you can help me, that will be great to me.Otherwise, I will slowly try to modify the code from your last time.By the way, thank for your help,I appreciate your kind assistance&lt;STRONG&gt;.&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:07:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10838269#M51089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T16:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847570#M51090</link>
      <description>&lt;P&gt;Hello, I have some question. I tried to modify your code below.You can see the example in dwg.If I use this lisp, it can do like the picture show.&lt;STRONG&gt;First question&lt;/STRONG&gt;,if I want to add text like"Top Height:" bu using cons 1, how can I modify that part to let me have text I need and value in excel at the same time.&lt;STRONG&gt;Second&amp;nbsp;question,&lt;/STRONG&gt;I used cons 10 set distance to put mtext near by original text position.But the positions are the same,so if I faced&amp;nbsp;&lt;SPAN&gt;vertical text ,the mtext created by lisp which position is not fit,is there any way to figure this problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the example.dwg ,those marks were created by artificial one by one.The final goal is that do the lisp to auto label that.If you have some great idea,please let me know.Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:QTEXTFIND (/ CELL FILENAME I ICOL INS1 IROW IROWS RNG SSET XLAPP XLBOOK XLCELL XLFRANGE XLRANGE XLRANGEC XLSHEET)
  (vl-load-com)
 (setq dic (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))

(mapcar 'setvar svnames '(0 0)); turn off Osnap, command echoing
(command "_.layer" "_make" "0S-EL" "_color" 7 "" "p"  "N" "" "");; &amp;lt;---EDIT Layer name/color as desired
(setq styht (cdr (assoc 40 (tblsearch "style" (getvar 'dimtxsty))))); height of text style in current dimension style
(if (= styht 0.0) (setq styht (* (getvar 'dimtxt) (getvar 'dimscale)))); if above is non-fixed-height
 
  
  (if (AND
	(setq sset (ssget '((-4 . "&amp;lt;OR") (0 . "MTEXT") (0 . "TEXT") (-4 . "OR&amp;gt;"))))
	(setq fileName (getfiled "Select Excel file to find cell address :" (getvar "dwgprefix") "xlsx;xls" 16))
	
	)
    (progn
      (setq xlApp (vlax-create-object "Excel.Application"))
	(vlax-put-property xlApp "Visible" :vlax-true)
	(setq xlBook (vlax-invoke-method (vlax-get-property xlApp 'WorkBooks) "Open" fileName ) )
	(vlax-invoke-method xlBook "Activate")
	(setq xlSheet (vlax-get-property (vlax-get-property xlBook "WorkSheets") "Item" 1) )

	(setq xlRangeC (vlax-invoke-method xlSheet "Activate") )
	 (setq xlRange (vlax-get-property xlSheet "Range" "A1:A1000"))
	  (vlax-invoke-method xlRange "Select")
         (setq iCol (vlax-get-property xlRange "Column"))
	(setq iRows (vlax-get-property(vlax-get-property xlRange "Rows") "Count" )iRow  (vlax-get-property xlRange "Row") )
	(setq rng (vlax-get-property xlApp 'Cells))

      
      (setq i 0)
      (repeat (sslength sset)
        
	(setq xlCell (vlax-invoke-method
      xlRange
      "Find"
      (vlax-make-variant (vla-get-TEXTSTRING (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
      xlFRange
      -4163
      1
      1
      1
      nil
      nil
           )
     )

 (setq cell (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 5 (vlax-get-property xlCell "Column")) )     )  ) ;第幾列
(setq cell2 (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 6 (vlax-get-property xlCell "Column")) )     )  ) ;第幾列


                     (setq ins1 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-insertionpoint (vlax-ename-&amp;gt;vla-object (ssname sset i))))))

	

	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 0) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (+(CADR ins1) 25) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1 (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 )) 
		   '(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
(setq p1 (LIST  (+(CAR ins1)70) (+(CADR ins1) 30) (CADDR ins1))
p2 (LIST  (+(CAR ins1)160) (-(CADR ins1) 20) (CADDR ins1))
p3 (LIST  (+(CAR ins1)70) (+(CADR ins1) 5) (CADDR ins1))
p4 (LIST  (+(CAR ins1)160) (+(CADR ins1) 5) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")
	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 2) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (CADR ins1) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1   (RTOS (vlax-variant-value  (vlax-get-property cell2 'value2)) 2 2 )) 
		   '(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
	
        (setq i (1+ i))
      )
      
    )
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 02:35:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847570#M51090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-29T02:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847769#M51091</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Because my language is not good&lt;BR /&gt;I did not understand you well&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you should use a block with attributeS&amp;nbsp; instead of Mtext&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 06:11:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847769#M51091</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-29T06:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847791#M51092</link>
      <description>&lt;P&gt;Sorry that my english is not good because I am Chinese.This row code can type the value in excel's cell.How to add string to show the string plus value which from excel.&lt;/P&gt;&lt;PRE&gt;(cons 1 (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 )) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;How to improve the position to let label to align the origin text and have&amp;nbsp;suitable position.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 06:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847791#M51092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-29T06:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847818#M51093</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 731px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1005681i85A3786496E8F1D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can specify the angle of the text if it is horizontal or vertical&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;Determine if you add the length or the width&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There should be no difference because the entry point does not change if the text is vertical or horizontal&lt;/P&gt;&lt;P&gt;See the picture you have a mistake&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 07:12:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847818#M51093</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-29T07:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847822#M51094</link>
      <description>&lt;P&gt;I did not understand this&lt;BR /&gt;Can you explain in a video?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to add another value to Excel?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 785px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1005682iDC414248D9D7CA7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 07:09:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847822#M51094</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-29T07:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847834#M51095</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(IF (= 0.0 (vla-get-ROTATION (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
  (PROGN
    
(setq p1 (LIST  (+(CAR ins1)70) (+(CADR ins1) 30) (CADDR ins1))
p2 (LIST  (+(CAR ins1)160) (-(CADR ins1) 20) (CADDR ins1))
p3 (LIST  (+(CAR ins1)70) (+(CADR ins1) 5) (CADDR ins1))
p4 (LIST  (+(CAR ins1)160) (+(CADR ins1) 5) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")

    )
  (PROGN

    CHANGE CODE FOR ROTATION /= 0.0 

    )
 )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Dec 2021 07:23:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847834#M51095</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-29T07:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847849#M51096</link>
      <description>&lt;P&gt;Like this&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 07:35:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847849#M51096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-29T07:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847860#M51097</link>
      <description>&lt;LI-CODE lang="csharp"&gt;(strcat "TOP: " (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 74px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1005688i839AB9C36FA00FDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Dec 2021 07:42:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10847860#M51097</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2021-12-29T07:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10849629#M51098</link>
      <description>&lt;P&gt;Hello,I tried to modify the code and figure out the problem last time.There are another two question. 1.If there is any tag not found in excel, show "error"&amp;nbsp; 2. make mtext from horizontal to vertical . I show the example in dwg, and the lisp I modified attached below. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 06:38:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10849629#M51098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-30T06:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to recognize mtext from cad to excel</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10852453#M51099</link>
      <description>&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;TRY&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;(defun c:EL (/ CELL FILENAME I ICOL INS1 IROW IROWS RNG SSET XLAPP XLBOOK XLCELL XLFRANGE XLRANGE XLRANGEC XLSHEET)
  (vl-load-com)
 (setq dic (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))

(mapcar 'setvar svnames '(0 0)); turn off Osnap, command echoing
(command "_.layer" "_make" "0S-EL" "_color" 7 "" "p"  "N" "" "");; &amp;lt;---EDIT Layer name/color as desired
(setq styht (cdr (assoc 40 (tblsearch "style" (getvar 'dimtxsty))))); height of text style in current dimension style
(if (= styht 0.0) (setq styht (* (getvar 'dimtxt) (getvar 'dimscale)))); if above is non-fixed-height
 
  
  (if (AND
	(setq sset (ssget '((-4 . "&amp;lt;OR") (0 . "MTEXT") (0 . "TEXT") (-4 . "OR&amp;gt;"))))
	(setq fileName (getfiled "Select Excel file to find cell address :" (getvar "dwgprefix") "xlsx;xls" 16))
	
	)
    (progn
      (setq xlApp (vlax-create-object "Excel.Application"))
	(vlax-put-property xlApp "Visible" :vlax-true)
	(setq xlBook (vlax-invoke-method (vlax-get-property xlApp 'WorkBooks) "Open" fileName ) )
	(vlax-invoke-method xlBook "Activate")
	(setq xlSheet (vlax-get-property (vlax-get-property xlBook "WorkSheets") "Item" 1) )

	(setq xlRangeC (vlax-invoke-method xlSheet "Activate") )
	 (setq xlRange (vlax-get-property xlSheet "Range" "A1:A1000"))
	  (vlax-invoke-method xlRange "Select")
         (setq iCol (vlax-get-property xlRange "Column"))
	(setq iRows (vlax-get-property(vlax-get-property xlRange "Rows") "Count" )iRow  (vlax-get-property xlRange "Row") )
	(setq rng (vlax-get-property xlApp 'Cells))

      
      (setq i 0)
      (repeat (sslength sset)

	(setq xlCell (vlax-invoke-method
      xlRange
      "Find"
      (vlax-make-variant (vla-get-TEXTSTRING (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
      xlFRange
      -4163
      1
      1
      1
      nil
      nil
           )
     )
	

	(IF (/= nil xlCell)
	  
	(PROGN  

 (setq cell (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 5 (vlax-get-property xlCell "Column")) )     )  ) ;ç¬¬å¹¾åˆ—
(setq cell2 (vlax-variant-value (vlax-get-property rng 'Item (vlax-get-property xlCell "Row") (+ 6 (vlax-get-property xlCell "Column")) )     )  ) ;ç¬¬å¹¾åˆ—

 
)
	 
	  )

                     (setq ins1 (vlax-safearray-&amp;gt;list (vlax-variant-value (vla-get-insertionpoint (vlax-ename-&amp;gt;vla-object (ssname sset i))))))


(IF (= 0.0 (vla-get-ROTATION (vlax-ename-&amp;gt;vla-object (ssname sset i)) ))
  (PROGN    ;horizontal part
	

	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 0) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (+(CADR ins1) 35) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1 (IF (/= nil xlCell)
			     (strcat "TOP: " (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))
			     (strcat "TOP: NIL ")
			     )
			 ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )

    
(setq p1 (LIST  (+(CAR ins1)70) (+(CADR ins1) 40) (CADDR ins1))
p2 (LIST  (+(CAR ins1)160) (-(CADR ins1) 10) (CADDR ins1))
p3 (LIST  (+(CAR ins1)70) (+(CADR ins1) 15) (CADDR ins1))
p4 (LIST  (+(CAR ins1)160) (+(CADR ins1) 15) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")
	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 2) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)85) (+(CADR ins1)10) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1  (IF (/= nil xlCell)
			 (strcat "BOT: " (RTOS (vlax-variant-value  (vlax-get-property cell2 'value2)) 2 2 ))
			      (strcat "BOT: NIL ")
			      )

			      ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
	)

  (PROGN    ;if not horizontal part

   (entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 0) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)20) (+(CADR ins1) 35) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1 (IF (/= nil xlCell)
			     (strcat "TOP: " (RTOS (vlax-variant-value  (vlax-get-property cell 'value2)) 2 2 ))
			     (strcat "TOP: NIL ")
			     )
			 ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
(setq p1 (LIST  (+(CAR ins1)5) (+(CADR ins1) 40) (CADDR ins1))
p2 (LIST  (+(CAR ins1)95) (-(CADR ins1) 10) (CADDR ins1))
p3 (LIST  (+(CAR ins1)5) (+(CADR ins1) 15) (CADDR ins1))
p4 (LIST  (+(CAR ins1)95) (+(CADR ins1) 15) (CADDR ins1))
)
(command "rectang" p1 p2)
(command "line" p3 p4 "")
	(entmakex (list '(0 . "MTEXT")
                       '(100 . "AcDbEntity")
		   '(67 . 0) '(8 . "0S-EL") '(62 . 2) 
		   '(6 . "Continuous")
		   '(100 . "AcDbMText") 
		   (cons 10  (LIST  (+(CAR ins1)20) (+(CADR ins1)10) (CADDR ins1) )) 
		   '(40 . 12) '(41 . 100) 
		   '(46 . 0) '(71 . 1) '(72 . 5)
		   (cons 1  (IF (/= nil xlCell)
			 (strcat "BOT: " (RTOS (vlax-variant-value  (vlax-get-property cell2 'value2)) 2 2 ))
			      (strcat "BOT: NIL ")
			      )

			      ) 
		   
'(7 . "NOTE") '(11 1 0 0)
		   '(42 . 133.3333333333333) '(43 . 100)
		   '(50 . 0) '(73 . 1) '(44 . 1)
 
                            ) 
                      )
    )
 )

        (setq i (1+ i))
      )
      
    )
  )
  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 314px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1006457iC02F75E73B310D07/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 10:56:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-recognize-mtext-from-cad-to-excel/m-p/10852453#M51099</guid>
      <dc:creator>hosneyalaa</dc:creator>
      <dc:date>2022-01-01T10:56:29Z</dc:date>
    </item>
  </channel>
</rss>

