<?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 edit block description with Excel, csv or text in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9181638#M81066</link>
    <description>&lt;DIV class="lia-message-body-content"&gt;&lt;BR /&gt;
&lt;DIV style="margin: 10px; border: 1px solid #000000; padding: 0.5em; background-color: #fcefb7;"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;EM&gt;I did not find anything rekeyed in Google, so probably this is the first time that anyone request this.&lt;/EM&gt;&lt;BR /&gt;You missed &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135" target="_blank" rel="noopener"&gt;this&lt;/A&gt; and &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/" target="_blank" rel="noopener"&gt;this&lt;/A&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;1.Read block description from CSV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; a. read the csv file [&lt;A href="http://lee-mac.com/readcsv.html" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;]&lt;/P&gt;
&lt;PRE&gt;(defun c:testread ( / data file )
    (if
        (and
            (setq file (getfiled "Select CSV File" "" "csv" 16))
            (setq data (LM:readcsv file))
        )
        (progn
            (foreach line data
				(print line)
                (block_desc (nth 0 line)(nth 1 line))
            )
        )
    )
    (princ)
)
(princ)


;;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135
(defun block_desc (bl_name bl_desc / bl_item bl_list)
	(cond
	((setq bl_item (tblobjname "BLOCK" bl_name))
	(cond
	((assoc 4 (setq bl_list (entget bl_item)))
	(entmake (subst (cons 4 bl_desc) (assoc 4 bl_list) bl_list))
	)
	(T (entmake (append bl_list (list (cons 4 bl_desc)))))
	);cond
	(setq bl_item (cdr (assoc -2 bl_list)))
	(while bl_item
	(entmake (entget bl_item))
	(setq bl_item (entnext bl_item))
	)
	(entmake (list (cons 0 "ENDBLK")))
	)
	(T nil)
	);cond
);defun&lt;/PRE&gt;
&lt;P&gt;2. Export block description : [ &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/?do=findComment&amp;amp;comment=472770" target="_blank" rel="noopener"&gt;Link&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2019 10:10:30 GMT</pubDate>
    <dc:creator>Ajilal.Vijayan</dc:creator>
    <dc:date>2019-12-04T10:10:30Z</dc:date>
    <item>
      <title>Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9181234#M81065</link>
      <description>&lt;P&gt;Anyone knows any lisp to edit block description?&lt;/P&gt;&lt;P&gt;Might be better if can import and export to Excel or csv or txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not find anything rekeyed in Google, so probably this is the first time that anyone request this.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 05:20:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9181234#M81065</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-12-04T05:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9181638#M81066</link>
      <description>&lt;DIV class="lia-message-body-content"&gt;&lt;BR /&gt;
&lt;DIV style="margin: 10px; border: 1px solid #000000; padding: 0.5em; background-color: #fcefb7;"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;EM&gt;I did not find anything rekeyed in Google, so probably this is the first time that anyone request this.&lt;/EM&gt;&lt;BR /&gt;You missed &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135" target="_blank" rel="noopener"&gt;this&lt;/A&gt; and &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/" target="_blank" rel="noopener"&gt;this&lt;/A&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;1.Read block description from CSV&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; a. read the csv file [&lt;A href="http://lee-mac.com/readcsv.html" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;]&lt;/P&gt;
&lt;PRE&gt;(defun c:testread ( / data file )
    (if
        (and
            (setq file (getfiled "Select CSV File" "" "csv" 16))
            (setq data (LM:readcsv file))
        )
        (progn
            (foreach line data
				(print line)
                (block_desc (nth 0 line)(nth 1 line))
            )
        )
    )
    (princ)
)
(princ)


;;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135
(defun block_desc (bl_name bl_desc / bl_item bl_list)
	(cond
	((setq bl_item (tblobjname "BLOCK" bl_name))
	(cond
	((assoc 4 (setq bl_list (entget bl_item)))
	(entmake (subst (cons 4 bl_desc) (assoc 4 bl_list) bl_list))
	)
	(T (entmake (append bl_list (list (cons 4 bl_desc)))))
	);cond
	(setq bl_item (cdr (assoc -2 bl_list)))
	(while bl_item
	(entmake (entget bl_item))
	(setq bl_item (entnext bl_item))
	)
	(entmake (list (cons 0 "ENDBLK")))
	)
	(T nil)
	);cond
);defun&lt;/PRE&gt;
&lt;P&gt;2. Export block description : [ &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/?do=findComment&amp;amp;comment=472770" target="_blank" rel="noopener"&gt;Link&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 10:10:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9181638#M81066</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2019-12-04T10:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182832#M81067</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/460083"&gt;@Ajilal.Vijayan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;EM&gt;I did not find anything rekeyed in Google, so probably this is the first time that anyone request this.&lt;/EM&gt;&lt;BR /&gt;You missed &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135" target="_blank" rel="noopener"&gt;this&lt;/A&gt; and &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/" target="_blank" rel="noopener"&gt;this&lt;/A&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;P&gt;1.Read block description from CSV&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; a. read the csv file [&lt;A href="http://lee-mac.com/readcsv.html" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;]&lt;/P&gt;&lt;PRE&gt;(defun c:testread ( / data file )
    (if
        (and
            (setq file (getfiled "Select CSV File" "" "csv" 16))
            (setq data (LM:readcsv file))
        )
        (progn
            (foreach line data
				(print line)
                (block_desc (nth 0 line)(nth 1 line))
            )
        )
    )
    (princ)
)
(princ)


;;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-block-description-in-autolisp/td-p/895135
(defun block_desc (bl_name bl_desc / bl_item bl_list)
	(cond
	((setq bl_item (tblobjname "BLOCK" bl_name))
	(cond
	((assoc 4 (setq bl_list (entget bl_item)))
	(entmake (subst (cons 4 bl_desc) (assoc 4 bl_list) bl_list))
	)
	(T (entmake (append bl_list (list (cons 4 bl_desc)))))
	);cond
	(setq bl_item (cdr (assoc -2 bl_list)))
	(while bl_item
	(entmake (entget bl_item))
	(setq bl_item (entnext bl_item))
	)
	(entmake (list (cons 0 "ENDBLK")))
	)
	(T nil)
	);cond
);defun&lt;/PRE&gt;&lt;P&gt;2. Export block description : [ &lt;A href="https://www.cadtutor.net/forum/topic/57053-export-block-count-and-description-in-excel/?do=findComment&amp;amp;comment=472770" target="_blank" rel="noopener"&gt;Link&lt;/A&gt; ]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;exporting to CSV file "block2excel.lsp" works great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but importing or read the file I have errors. so, What should I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Command:
Command: Specify opposite corner or [Fence/WPolygon/CPolygon]:
Command: CSVREAD
; error: no function definition: LM:READCSV
Command:&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:54:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182832#M81067</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-12-04T18:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182836#M81068</link>
      <description>&lt;P&gt;&lt;A href="http://www.lee-mac.com/readcsv.html" target="_blank" rel="noopener"&gt;http://www.lee-mac.com/readcsv.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182836#M81068</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2019-12-04T18:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182974#M81069</link>
      <description>&lt;P&gt;the tested files are inside of "Apartman example.zip", attached below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using "Blocks2Excel-v1.1.LSP", attached below, to export block data (layer, name, count, description)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output file has the name "block2excel-exported.csv" inside attached .zip&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;but when I tried to use "CSVread.lsp" to import the modified&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the input file has the name "block2excel-to import.csv" inside attached .zip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RESULT:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;Command: (LOAD "C:/Users/jtm2019hyo/Google Drive/@Programing/@CAD/LSP-VLX/TABLE/DESCRIPTION/LEE MAC - Read CSV/CSVread/CSVread.lsp") BLOCK_DESC
Command: CSVREAD
; error: no function definition: LM:READCSV
Command:&lt;/PRE&gt;&lt;P&gt;so, I don't know what I did bad.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 19:55:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9182974#M81069</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-12-04T19:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9183644#M81070</link>
      <description>&lt;P&gt;You need to have this defun&amp;nbsp;(LM:readcsv file)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see here&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lee-mac.com/lisp/html/ReadCSV-V1-3.html" target="_blank"&gt;http://www.lee-mac.com/lisp/html/ReadCSV-V1-3.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 02:52:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9183644#M81070</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2019-12-05T02:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9183764#M81071</link>
      <description>&lt;P&gt;&lt;EM&gt;; error: no function definition: LM:READCSV&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.lee-mac.com/lisp/html/ReadCSV-V1-3.html" target="_blank" rel="noopener"&gt;Copy the code from here&lt;/A&gt;&amp;nbsp; and add to the end of your CSVread.lsp file to fix the above error.&lt;/P&gt;
&lt;P&gt;Also if you are using the exported csv file format to read the description, then update the code in CSVread.lsp file also&lt;/P&gt;
&lt;PRE&gt;(block_desc (nth &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/FONT&gt; line)(nth &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; line))&lt;/PRE&gt;
&lt;P&gt;The number 0 and 1 in above code refers to the first and second column of CSV.&lt;/P&gt;
&lt;P&gt;Layer Name:;&lt;U&gt;Block Name&lt;/U&gt;:;QTY;&lt;U&gt;Description&lt;/U&gt;&lt;BR /&gt;0;&lt;FONT color="#0000FF"&gt;ROOM-SYM&lt;/FONT&gt;;4;&lt;FONT color="#0000FF"&gt;asdw&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;so update the code to refer the correct column numbers&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;(block_desc (nth &lt;FONT color="#0000FF"&gt;1&lt;/FONT&gt; line)(nth &lt;FONT color="#0000FF"&gt;3&lt;/FONT&gt; line));;values from second and fourth column [ zero based index ]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 05:28:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9183764#M81071</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2019-12-05T05:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to edit block description with Excel, csv or text</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9185442#M81072</link>
      <description>&lt;P&gt;thanks a lot&lt;BR /&gt;&lt;BR /&gt;attached the lisp that, I'm using for anyone.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 18:51:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-edit-block-description-with-excel-csv-or-text/m-p/9185442#M81072</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-12-05T18:51:46Z</dc:date>
    </item>
  </channel>
</rss>

