<?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 Lisp script to generate list of all layouts / table of contents as a csv in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203001#M5306</link>
    <description>&lt;P&gt;Hi forum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a lisp I use to generate a .csv list of all layouts that exist in the active document to a subfolder in the same directory named "table of contents".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with this lisp is that is that the layouts are listed alphabetically instead of following the order in which they are organized in the dwg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody help me to transform the lisp into following the document order, so I can actually consider this list as a table of contents? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:ExportLayoutsToCSV ()&lt;BR /&gt;(if (not (vl-load-com)) (vl-load-com)) ; Load COM support if not already loaded&lt;/P&gt;&lt;P&gt;;; Get the full path of the active document&lt;BR /&gt;(setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))&lt;BR /&gt;(setq doc-path (vlax-get-property doc 'Path))&lt;BR /&gt;(setq doc-name (vlax-get-property doc 'Name))&lt;/P&gt;&lt;P&gt;;; Ensure the document path exists&lt;BR /&gt;(if doc-path&lt;BR /&gt;(progn&lt;BR /&gt;;; Construct the "table of contents" folder path&lt;BR /&gt;(setq toc-folder (strcat doc-path "\\table of contents"))&lt;/P&gt;&lt;P&gt;;; Check if folder exists, if not create it&lt;BR /&gt;(if (not (vl-file-directory-p toc-folder))&lt;BR /&gt;(vl-mkdir toc-folder)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Construct the CSV file path&lt;BR /&gt;(setq csv-file-name (strcat "Table of Contents - " (vl-filename-base doc-name) ".csv"))&lt;BR /&gt;(setq csv-file-path (strcat toc-folder "\\" csv-file-name))&lt;/P&gt;&lt;P&gt;;; Get the list of layout names&lt;BR /&gt;(setq layout-list (layoutlist))&lt;/P&gt;&lt;P&gt;;; Open file for writing&lt;BR /&gt;(setq file-handle (open csv-file-path "w"))&lt;BR /&gt;(if file-handle&lt;BR /&gt;(progn&lt;BR /&gt;;; Write the layout names to the file&lt;BR /&gt;(foreach layout layout-list&lt;BR /&gt;(write-line layout file-handle)&lt;BR /&gt;)&lt;BR /&gt;(princ (strcat "\nLayout names exported to: " csv-file-path))&lt;BR /&gt;(close file-handle)&lt;BR /&gt;)&lt;BR /&gt;(princ "\nError: Unable to open file for writing.")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ "\nError: Unable to determine the document path.")&lt;BR /&gt;)&lt;BR /&gt;(princ) ; Suppress return value in the command line&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2024 10:49:25 GMT</pubDate>
    <dc:creator>studiomaybebxl</dc:creator>
    <dc:date>2024-12-10T10:49:25Z</dc:date>
    <item>
      <title>Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203001#M5306</link>
      <description>&lt;P&gt;Hi forum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a lisp I use to generate a .csv list of all layouts that exist in the active document to a subfolder in the same directory named "table of contents".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with this lisp is that is that the layouts are listed alphabetically instead of following the order in which they are organized in the dwg.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can somebody help me to transform the lisp into following the document order, so I can actually consider this list as a table of contents? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:ExportLayoutsToCSV ()&lt;BR /&gt;(if (not (vl-load-com)) (vl-load-com)) ; Load COM support if not already loaded&lt;/P&gt;&lt;P&gt;;; Get the full path of the active document&lt;BR /&gt;(setq doc (vla-get-ActiveDocument (vlax-get-Acad-Object)))&lt;BR /&gt;(setq doc-path (vlax-get-property doc 'Path))&lt;BR /&gt;(setq doc-name (vlax-get-property doc 'Name))&lt;/P&gt;&lt;P&gt;;; Ensure the document path exists&lt;BR /&gt;(if doc-path&lt;BR /&gt;(progn&lt;BR /&gt;;; Construct the "table of contents" folder path&lt;BR /&gt;(setq toc-folder (strcat doc-path "\\table of contents"))&lt;/P&gt;&lt;P&gt;;; Check if folder exists, if not create it&lt;BR /&gt;(if (not (vl-file-directory-p toc-folder))&lt;BR /&gt;(vl-mkdir toc-folder)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;;; Construct the CSV file path&lt;BR /&gt;(setq csv-file-name (strcat "Table of Contents - " (vl-filename-base doc-name) ".csv"))&lt;BR /&gt;(setq csv-file-path (strcat toc-folder "\\" csv-file-name))&lt;/P&gt;&lt;P&gt;;; Get the list of layout names&lt;BR /&gt;(setq layout-list (layoutlist))&lt;/P&gt;&lt;P&gt;;; Open file for writing&lt;BR /&gt;(setq file-handle (open csv-file-path "w"))&lt;BR /&gt;(if file-handle&lt;BR /&gt;(progn&lt;BR /&gt;;; Write the layout names to the file&lt;BR /&gt;(foreach layout layout-list&lt;BR /&gt;(write-line layout file-handle)&lt;BR /&gt;)&lt;BR /&gt;(princ (strcat "\nLayout names exported to: " csv-file-path))&lt;BR /&gt;(close file-handle)&lt;BR /&gt;)&lt;BR /&gt;(princ "\nError: Unable to open file for writing.")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ "\nError: Unable to determine the document path.")&lt;BR /&gt;)&lt;BR /&gt;(princ) ; Suppress return value in the command line&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 10:49:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203001#M5306</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-10T10:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203421#M5307</link>
      <description>&lt;P&gt;Maybe try replacing this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;; Get the list of layout names
(setq layout-list (layoutlist))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with these:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; getLayoutOrderList retrieves layout names by order they're positioned in dwg
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/retrieve-layout-names-by-order-of-which-they-sit-to-populate-in/td-p/10117384
(defun getLayoutOrderList( / lst mklist mappend flatten)
	(defun mklist (x) (if (listp x) x (list x)))
	(defun mappend (fn lst)(apply 'append (mapcar fn lst))) 
	(defun flatten (expr)(mappend 'mklist expr))
	(vlax-for lay 
		(vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
		(setq lst (cons (list (vla-get-taborder lay)(vla-get-name lay)) lst))
	)
	(cdr(flatten(mapcar 'cdr (vl-sort lst '(lambda (a b) (&amp;lt; (car a)(car b)))))))
)

;; Get the list of layout names in tab order
(setq layout-list (getLayoutOrderList))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:15:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203421#M5307</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T18:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203745#M5308</link>
      <description>&lt;P&gt;Hi, thanks for the input.&lt;/P&gt;&lt;P&gt;This seems to work for Autocad LT&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:23:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203745#M5308</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-10T18:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203759#M5309</link>
      <description>&lt;P&gt;Unfortunately, I'm running on AutoCAD and not LT. Perhaps others can jump in here to confirm if this function would cause that error on LT:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun getLayoutOrderList( / lst mklist mappend flatten)
	(defun mklist (x) (if (listp x) x (list x)))
	(defun mappend (fn lst)(apply 'append (mapcar fn lst))) 
	(defun flatten (expr)(mappend 'mklist expr))
	(vlax-for lay 
		(vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
		(setq lst (cons (list (vla-get-taborder lay)(vla-get-name lay)) lst))
	)
	(cdr(flatten(mapcar 'cdr (vl-sort lst '(lambda (a b) (&amp;lt; (car a)(car b)))))))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:21:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203759#M5309</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T18:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203767#M5310</link>
      <description>&lt;P&gt;just to rule out any typos, can you copy and paste the following directly onto the command line in LT to see what it returns?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun getLayoutOrderList( / lst mklist mappend flatten)
	(defun mklist (x) (if (listp x) x (list x)))
	(defun mappend (fn lst)(apply 'append (mapcar fn lst))) 
	(defun flatten (expr)(mappend 'mklist expr))
	(vlax-for lay 
		(vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
		(setq lst (cons (list (vla-get-taborder lay)(vla-get-name lay)) lst))
	)
	(cdr(flatten(mapcar 'cdr (vl-sort lst '(lambda (a b) (&amp;lt; (car a)(car b)))))))
)(GETLAYOUTORDERLIST)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:23:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203767#M5310</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T18:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203775#M5311</link>
      <description>&lt;P&gt;glad that worked out for you...cheers!!!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:27:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203775#M5311</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T18:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203777#M5312</link>
      <description>&lt;P&gt;Thank you this works very well on autocad LT! It gives me back a list with the layouts in the correct order&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:27:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203777#M5312</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-10T18:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203782#M5313</link>
      <description>&lt;P&gt;you are welcome...cheers!!!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 18:28:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203782#M5313</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T18:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203889#M5314</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't mind me asking,&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Would you see a way to extend this script with an additional feature that generates an extra column in the CSV containing the title of each layout? The user will need to write the title somewhere on the corresponding layout in text or mtext format on a specific designated layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping me out so far!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Dec 2024 19:30:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203889#M5314</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-10T19:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203904#M5315</link>
      <description>&lt;P&gt;Isn’t the title of the layout the same as the layout name? &amp;nbsp;If not where is the title on each layout coming from?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 19:36:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203904#M5315</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T19:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203939#M5316</link>
      <description>&lt;P&gt;Ah yes, I see how this is confusing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact the layout name is actually an abbreviation of the actual title. We tend to keep those compact to have a better overview of the layouts when working in the document. The full title is always a bit longer and clarifies the set layout more specifically. We have it on a set spot on each layout tab inserted as text / mtext.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I was thinking if we stick to using a designated layer for these full titles, it might be somehow achievable to also export these in a separate column in the .csv in the same lisp-routine. That way the csv will show rows of 2 columns with both the layout-name as well as the corresponding full title.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 19:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13203939#M5316</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-10T19:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13204060#M5317</link>
      <description>&lt;P&gt;Yes, using a designated layer where only that Text/MText object would be placed in each layout would work.&lt;/P&gt;&lt;P&gt;Or you create a Block that has an Attribute that contains the Title inserted once in each layout.&lt;/P&gt;&lt;P&gt;This would be another way to select and filter that out per layout.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 21:14:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13204060#M5317</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-10T21:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13204253#M5318</link>
      <description>&lt;P&gt;Best way to go "&lt;SPAN&gt;Or you create a Block that has an Attribute that contains the Title"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The attached makes a dwg index as a table reading all layouts and getting values from the title block in each layout may be useful. You will need to edit to suit your title block.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2024 23:59:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13204253#M5318</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-10T23:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13207597#M5319</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the lisp. I have been trying to use it and managed to setup the value of the DRG_NO (drawing number attribute) as the "ctab" field. It still works as intended, great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when it comes to the order in which the rows of the table are generated, it seems like it is also doing it alphabetically, instead of following the order of how the layouts are organized in the document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you see a way on how to adjust the lisp to genrate a list where the rows are ordered following the document layout order?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 14:04:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13207597#M5319</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-12T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208722#M5320</link>
      <description>&lt;P&gt;To get the layouts in the visual order it should work if you use (layoutlist) it returns a list of the layout names in correct order. need a foreach loop making the selection set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote the program like 5 years ago so will look at updating. Added to my to list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 22:43:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208722#M5320</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-12T22:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208744#M5321</link>
      <description>&lt;P&gt;I’ve used this function in case you want to keep the order as positioned within the drawing&lt;/P&gt;&lt;LI-CODE lang="general"&gt; ; getLayoutOrderList retrieves layout names by order they're positioned in dwg
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/retrieve-layout-names-by-order-of-which-they-sit-to-populate-in/td-p/10117384
 (defun getLayoutOrderList( / lst mklist mappend flatten)
	(defun mklist (x) (if (listp x) x (list x)))
	(defun mappend (fn lst)(apply 'append (mapcar fn lst))) 
	(defun flatten (expr)(mappend 'mklist expr))
	(vlax-for lay 
		(vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
		(setq lst (cons (list (vla-get-taborder lay)(vla-get-name lay)) lst))
	)
	(cdr(flatten(mapcar 'cdr (vl-sort lst '(lambda (a b) (&amp;lt; (car a)(car b)))))))
 )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Dec 2024 22:57:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208744#M5321</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-12T22:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208791#M5322</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;something like this. Will look at updating.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq bname "DA1DRTXT")
(setq lst '())
(vlax-for lay 
		(vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
		(setq lst (cons (list (vla-get-taborder lay)(vla-get-name lay)) lst))
	)
(setq lst (vl-sort lst '(lambda (a b) (&amp;lt; (car a)(car b)))))
(setq ssl (ssadd))
(foreach val lst
  (if (= (car val) 0)
  (princ)
  (progn
   (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 bname)(cons 410 (cadr val)))))
   (setq ssl (ssadd (ssname ss 0) ssl))
  )
)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 23:32:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13208791#M5322</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-12-12T23:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210614#M5323</link>
      <description>&lt;P&gt;Hi, I find it difficult to combine these functions, I don't seem to get it to work and get the layout order right with my limited understanding of it. Also one thing I noticed is that the Dwgindex lisp only works succesfully if each individual layout has been opened during the session. Layouts that were not accessed during the session will be skipped in the eventual table. Curious to know if you're aware of this? It is mostly a bit inconvenient when you have lots of layouts, and don't necessarily open each one individually each session...&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 19:02:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210614#M5323</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-13T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210624#M5324</link>
      <description>I assume this is the best method to continue to achieve incorporating more detailed title text in the .csv file, but I struggle a bit with finding the right strings of code here. Do you think you could elaborate a bit more on how to include such a filter system to generate title information using a custom text attribute? Thanks</description>
      <pubDate>Fri, 13 Dec 2024 19:07:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210624#M5324</guid>
      <dc:creator>studiomaybebxl</dc:creator>
      <dc:date>2024-12-13T19:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp script to generate list of all layouts / table of contents as a csv</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210640#M5325</link>
      <description>&lt;P&gt;That will depend on what method you’ve decided to go with to store the longer title in each layout. Are you going with Text object on a specific layer or block with attribute? &amp;nbsp;Perhaps share a sample dwg with multiple layouts so we can all test&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 19:21:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-script-to-generate-list-of-all-layouts-table-of-contents-as/m-p/13210640#M5325</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-12-13T19:21:59Z</dc:date>
    </item>
  </channel>
</rss>

