<?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: Creating a table of layout index lisp, want to display layout list as they were not in order, please help in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109577#M63794</link>
    <description>&lt;P&gt;Here is full code;&lt;/P&gt;&lt;P&gt;The code creates table, only thing i want - layout list not to be sorted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; dwg index to a table&lt;BR /&gt;; modified 2020 (JW)&lt;/P&gt;&lt;P&gt;(defun CBC:dwgindex2 (/ lentab ss1 ans2 ans3 ans4 ans5 anstab tag2 tag3 tag4 tag5 list1 list2 list3 list4 list5 listtab curlayout INC *PS* I LST MYTABLE PT1 SSET acmcol t_style1 t_style2 rep1 num aobj adoc)&lt;/P&gt;&lt;P&gt;(vl-load-com)&lt;BR /&gt;(setq curlayout (getvar "ctab"))&lt;BR /&gt;(if (= curlayout "Model")&lt;BR /&gt;(progn&lt;BR /&gt;(Alert "You need to be in a layout for this option")&lt;BR /&gt;(exit)&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if model&lt;/P&gt;&lt;P&gt;; lisp part1 - get title block attributes, source AH &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-extracting-title-block-info/td-p/9409759" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-extracting-title-block-info/td-p/9409759&lt;/A&gt;&lt;BR /&gt;(setq bname "CBCRMSA3LAYOUT") ; title block name&lt;BR /&gt;(setq list0 (layoutlist)) ;JW - create temp list with all layouts&lt;BR /&gt;(setq list1 (vl-remove (nth 0 list0) list0)) ;JW - remove cover page from list ((vl-remove (nth x list)) removes x number of items from list, first item starts from 0)&lt;BR /&gt;(setq tag2 "SHEET-DETAILS/CHAINAGE-RANGE") ;attribute tag name&lt;BR /&gt;(setq tag3 "ISSUE") ;attribute tag name&lt;BR /&gt;(setq tag4 "1") ;attribute tag name&lt;BR /&gt;(setq tag5 "2") ;attribute tag name&lt;BR /&gt;(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname))))&lt;/P&gt;&lt;P&gt;(setq INC (sslength ss1))&lt;BR /&gt;(repeat INC&lt;BR /&gt;(foreach att (vlax-invoke (vlax-ename-&amp;gt;vla-object (ssname SS1 (SETQ INC (- INC 1)) )) 'getattributes)&lt;BR /&gt;(if (= tag2 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans2 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans2 NIL)&lt;BR /&gt;(setq list2 (cons ans2 list2))&lt;BR /&gt;) ; if&lt;BR /&gt;); end progn&lt;BR /&gt;) ; end if - created list2 from attribute tag2&lt;/P&gt;&lt;P&gt;(if (= tag3 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans3 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans3 NIL)&lt;BR /&gt;(setq list3 (cons ans3 list3))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list3 from attribute tag3&lt;/P&gt;&lt;P&gt;(if (= tag4 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans4 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans4 NIL)&lt;BR /&gt;(setq list4 (cons ans4 list4))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list4 from attribute tab4&lt;/P&gt;&lt;P&gt;(if (= tag5 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans5 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans5 NIL)&lt;BR /&gt;(setq list5 (cons ans5 list5))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list5 from attribute tab5&lt;BR /&gt;) ; end foreach&lt;BR /&gt;) ; end repeat&lt;/P&gt;&lt;P&gt;;lisp part2 concatenate attributes: Bigal &lt;A href="https://www.cadtutor.net/forum/topic/54784-combining-lists/" target="_blank"&gt;https://www.cadtutor.net/forum/topic/54784-combining-lists/&lt;/A&gt;&lt;BR /&gt;(setq lentab (length list2)) ; JW - set number of repetitions as lentab&lt;BR /&gt;(setq x 0) ; JW - set variable x to track number of reps&lt;BR /&gt;(repeat lentab&lt;BR /&gt;(setq anstab (strcat (nth x list2) " SHEET " (nth x list4) " OF " (nth x list5)))&lt;BR /&gt;(setq listtab (cons anstab listtab))&lt;BR /&gt;(setq x (+ x 1))&lt;BR /&gt;) ; end repeat. JW - for each x from 0 to "lentab", concatenate and add to list "listtab"&lt;BR /&gt;(setq listtab (reverse listtab)) ; JW - reverses list to correct order&lt;/P&gt;&lt;P&gt;; JW - this next line might be useless, try deleting this later&lt;BR /&gt;(setvar 'ctab curlayout)&lt;/P&gt;&lt;P&gt;; part 3 - create table style template and generate table, source: INDEXREVDATE.lsp&lt;/P&gt;&lt;P&gt;; create an empty list, set a counter variable, and&lt;BR /&gt;; set a reference to the current model space.&lt;BR /&gt;(setq lst '() i 0)&lt;/P&gt;&lt;P&gt;(setq aobj (vlax-get-acad-object))&lt;BR /&gt;(setq adoc (vla-get-activedocument aobj))&lt;BR /&gt;(setq *ps* (vla-get-paperspace adoc))&lt;BR /&gt;(setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table: "))) ;JW - select insertion point with cursor&lt;/P&gt;&lt;P&gt;(setq acmCol (vla-getinterfaceobject&lt;BR /&gt;(vlax-get-acad-object)&lt;BR /&gt;(strcat "AutoCAD.AcCmColor."&lt;BR /&gt;(substr (getvar "ACADVER") 1 2))))&lt;/P&gt;&lt;P&gt;(setq t_Style1 (vla-item (vla-get-dictionaries adoc) "acad_tablestyle")&lt;BR /&gt;t_Style2 (vla-addObject t_Style1 "CBC_Dwg_Index_Table" "AcDbTableStyle")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(vla-setgridvisibility t_style2 (+ acHorztop acVertleft acVertright)&lt;BR /&gt;(+ acTitlerow):vlax-false)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 41 41 41)&lt;BR /&gt;(vla-put-colorindex acmcol 008)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acVertLeft acHorzTop acVertRight) acTitleRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzInside) acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 0 255 255)&lt;BR /&gt;(vla-put-colorindex acmcol acCyan)&lt;BR /&gt;(vla-setcolor t_style2 acTitleRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzBottom acHorzInside acVertInside) acHeaderRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzBottom acVertLeft acVertRight acVertInside) acDataRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acHeaderRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 0 255 0)&lt;BR /&gt;(vla-put-colorindex acmcol acGreen)&lt;BR /&gt;(vla-setcolor t_style2 acHeaderRow acmCol)&lt;BR /&gt;(vla-setcolor t_style2 acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setAlignment t_style2 acTitleRow acMiddleCenter)&lt;BR /&gt;(vla-setAlignment t_style2 acHeaderRow acMiddleCenter)&lt;BR /&gt;(vla-setAlignment t_style2 acDataRow acMiddleCenter)&lt;/P&gt;&lt;P&gt;(vla-SetTextHeight t_Style2 acTitleRow 2.5)&lt;BR /&gt;(vla-SetTextHeight t_Style2 acHeaderRow 1.8)&lt;BR /&gt;(vla-SetTextHeight t_Style2 acDataRow 1.8)&lt;BR /&gt;(vla-SetTextStyle t_Style2 acTitleRow "RMS - 2.5mm")&lt;BR /&gt;(vla-SetTextStyle t_Style2 acHeaderRow "RMS - 1.8mm")&lt;BR /&gt;(vla-SetTextStyle t_Style2 acDataRow "RMS - 1.8mm")&lt;BR /&gt;(vla-put-Vertcellmargin t_Style2 0.5)&lt;BR /&gt;(vla-put-Horzcellmargin t_Style2 2)&lt;/P&gt;&lt;P&gt;(setq myTable (vla-AddTable *ps* pt1 (+ 2 (length list1)) 3 7 185)) ;JW - Create table&lt;BR /&gt;(vla-put-StyleName myTable "CBC_Dwg_Index_Table") ;JW - Table style&lt;BR /&gt;(vla-put-layer mytable "N-NOTES") ;JW - Table layer&lt;/P&gt;&lt;P&gt;(vla-setRowHeight mytable 0 5)&lt;BR /&gt;(vla-setRowHeight mytable 1 5)&lt;BR /&gt;(vla-setRowHeight mytable 2 5)&lt;BR /&gt;(vla-setColumnWidth mytable 0 25)&lt;BR /&gt;(vla-setColumnWidth mytable 1 85)&lt;BR /&gt;(vla-setColumnWidth mytable 2 10)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;set the header/title texts&lt;BR /&gt;(vla-setText mytable 0 0 "DRAWING INDEX")&lt;BR /&gt;(vla-setText mytable 1 0 "SHEET NO. / SET")&lt;BR /&gt;(vla-setText mytable 1 1 "SHEET DESCRIPTION")&lt;BR /&gt;(vla-setText mytable 1 2 "ISSUE")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(setq rep1 2) ;JW - variable used to progress table rows&lt;BR /&gt;(setq num 0) ;JW - variable used to get data from lists&lt;/P&gt;&lt;P&gt;(repeat (length list1)&lt;BR /&gt;(vla-setRowHeight mytable rep1 5)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 0 acMiddleLeft)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 1 acMiddleLeft)&lt;BR /&gt;(vla-settext mytable rep1 0 (NTH num LIST1))&lt;BR /&gt;(vla-settext mytable rep1 1 (NTH num LISTtab))&lt;BR /&gt;(vla-settext mytable rep1 2 (NTH num LIST3))&lt;BR /&gt;(setq num (+ num 1))&lt;BR /&gt;(setq rep1 (+ rep1 1))&lt;BR /&gt;); end repeat&lt;/P&gt;&lt;P&gt;;set drawing sheet set row bottom cyan (NOT USED)&lt;BR /&gt;;(vla-mergecells myTable 2 2 0 2)&lt;BR /&gt;;(vla-setCellAlignment mytable 2 0 acMiddleLeft)&lt;BR /&gt;;(vla-setrgb acmCol 0 255 255)&lt;BR /&gt;;(vla-put-colorindex acmcol acCyan)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 0 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 1 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 2 acBottomMask acmCol)&lt;/P&gt;&lt;P&gt;(vlax-release-object aobj)&lt;BR /&gt;(vlax-release-object adoc)&lt;BR /&gt;(vlax-release-object myTable)&lt;BR /&gt;(vlax-release-object *ps*)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;); end JW defun&lt;/P&gt;&lt;P&gt;(CBC:dwgindex2)&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 21:27:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-02-24T21:27:35Z</dc:date>
    <item>
      <title>Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109392#M63792</link>
      <description>&lt;P&gt;Hi I have a draft lisp shown below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq myTable (vla-AddTable *ps* pt1 (+ 2 (length list1)) 3 7 185)) ;JW - Create table&lt;BR /&gt;(vla-put-StyleName myTable "CBC_Dwg_Index_Table") ;JW - Table style&lt;BR /&gt;(vla-put-layer mytable "N-NOTES") ;JW - Table layer&lt;/P&gt;&lt;P&gt;(vla-setRowHeight mytable 0 5)&lt;BR /&gt;(vla-setRowHeight mytable 1 5)&lt;BR /&gt;(vla-setRowHeight mytable 2 5)&lt;BR /&gt;(vla-setColumnWidth mytable 0 25)&lt;BR /&gt;(vla-setColumnWidth mytable 1 85)&lt;BR /&gt;(vla-setColumnWidth mytable 2 10)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;set the header/title texts&lt;BR /&gt;(vla-setText mytable 0 0 "DRAWING INDEX")&lt;BR /&gt;(vla-setText mytable 1 0 "SHEET NO. / SET")&lt;BR /&gt;(vla-setText mytable 1 1 "SHEET DESCRIPTION")&lt;BR /&gt;(vla-setText mytable 1 2 "ISSUE")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(setq rep1 2) ;JW - variable used to progress table rows&lt;BR /&gt;(setq num 0) ;JW - variable used to get data from lists&lt;/P&gt;&lt;P&gt;(repeat (length list1)&lt;BR /&gt;(vla-setRowHeight mytable rep1 5)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 0 acMiddleLeft)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 1 acMiddleLeft)&lt;BR /&gt;(vla-settext mytable rep1 0 (NTH num LIST1))&lt;BR /&gt;(vla-settext mytable rep1 1 (NTH num LISTtab))&lt;BR /&gt;(vla-settext mytable rep1 2 (NTH num LIST3))&lt;BR /&gt;(setq num (+ num 1))&lt;BR /&gt;(setq rep1 (+ rep1 1))&lt;BR /&gt;); end repeat&lt;/P&gt;&lt;P&gt;;set drawing sheet set row bottom cyan (NOT USED)&lt;BR /&gt;;(vla-mergecells myTable 2 2 0 2)&lt;BR /&gt;;(vla-setCellAlignment mytable 2 0 acMiddleLeft)&lt;BR /&gt;;(vla-setrgb acmCol 0 255 255)&lt;BR /&gt;;(vla-put-colorindex acmcol acCyan)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 0 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 1 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 2 acBottomMask acmCol)&lt;/P&gt;&lt;P&gt;(vlax-release-object aobj)&lt;BR /&gt;(vlax-release-object adoc)&lt;BR /&gt;(vlax-release-object myTable)&lt;BR /&gt;(vlax-release-object *ps*)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;); end JW defun&lt;/P&gt;&lt;P&gt;(CBC:dwgindex2)&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 20:19:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109392#M63792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T20:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109522#M63793</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You did not post your full code, so there are variables which we cannot see how they were created.&lt;/P&gt;&lt;P&gt;This might be useful for you. It will return the layout sheets in the order they appear.&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun LayoutListOrdered ( / dLays lays oLays cnt)
  (setq dLays (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_LAYOUT"))))
  (setq lays (mapcar '(lambda (l) (cons (cdr (assoc 71 (dictsearch dLays l))) l)) (layoutlist)))
  (repeat (1- (setq cnt (1+ (length lays))))
    (setq oLays (cons (cdr (assoc (setq cnt (1- cnt)) lays)) oLays))
  );repeat
);defun&lt;/LI-CODE&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 21:03:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109522#M63793</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-24T21:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109577#M63794</link>
      <description>&lt;P&gt;Here is full code;&lt;/P&gt;&lt;P&gt;The code creates table, only thing i want - layout list not to be sorted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; dwg index to a table&lt;BR /&gt;; modified 2020 (JW)&lt;/P&gt;&lt;P&gt;(defun CBC:dwgindex2 (/ lentab ss1 ans2 ans3 ans4 ans5 anstab tag2 tag3 tag4 tag5 list1 list2 list3 list4 list5 listtab curlayout INC *PS* I LST MYTABLE PT1 SSET acmcol t_style1 t_style2 rep1 num aobj adoc)&lt;/P&gt;&lt;P&gt;(vl-load-com)&lt;BR /&gt;(setq curlayout (getvar "ctab"))&lt;BR /&gt;(if (= curlayout "Model")&lt;BR /&gt;(progn&lt;BR /&gt;(Alert "You need to be in a layout for this option")&lt;BR /&gt;(exit)&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if model&lt;/P&gt;&lt;P&gt;; lisp part1 - get title block attributes, source AH &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-extracting-title-block-info/td-p/9409759" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-extracting-title-block-info/td-p/9409759&lt;/A&gt;&lt;BR /&gt;(setq bname "CBCRMSA3LAYOUT") ; title block name&lt;BR /&gt;(setq list0 (layoutlist)) ;JW - create temp list with all layouts&lt;BR /&gt;(setq list1 (vl-remove (nth 0 list0) list0)) ;JW - remove cover page from list ((vl-remove (nth x list)) removes x number of items from list, first item starts from 0)&lt;BR /&gt;(setq tag2 "SHEET-DETAILS/CHAINAGE-RANGE") ;attribute tag name&lt;BR /&gt;(setq tag3 "ISSUE") ;attribute tag name&lt;BR /&gt;(setq tag4 "1") ;attribute tag name&lt;BR /&gt;(setq tag5 "2") ;attribute tag name&lt;BR /&gt;(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname))))&lt;/P&gt;&lt;P&gt;(setq INC (sslength ss1))&lt;BR /&gt;(repeat INC&lt;BR /&gt;(foreach att (vlax-invoke (vlax-ename-&amp;gt;vla-object (ssname SS1 (SETQ INC (- INC 1)) )) 'getattributes)&lt;BR /&gt;(if (= tag2 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans2 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans2 NIL)&lt;BR /&gt;(setq list2 (cons ans2 list2))&lt;BR /&gt;) ; if&lt;BR /&gt;); end progn&lt;BR /&gt;) ; end if - created list2 from attribute tag2&lt;/P&gt;&lt;P&gt;(if (= tag3 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans3 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans3 NIL)&lt;BR /&gt;(setq list3 (cons ans3 list3))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list3 from attribute tag3&lt;/P&gt;&lt;P&gt;(if (= tag4 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans4 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans4 NIL)&lt;BR /&gt;(setq list4 (cons ans4 list4))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list4 from attribute tab4&lt;/P&gt;&lt;P&gt;(if (= tag5 (strcase (vla-get-tagstring att)))&lt;BR /&gt;(progn&lt;BR /&gt;(setq ans5 (vla-get-textstring att))&lt;BR /&gt;(if (/= ans5 NIL)&lt;BR /&gt;(setq list5 (cons ans5 list5))&lt;BR /&gt;) ; end if&lt;BR /&gt;) ; end progn&lt;BR /&gt;) ; end if - created list5 from attribute tab5&lt;BR /&gt;) ; end foreach&lt;BR /&gt;) ; end repeat&lt;/P&gt;&lt;P&gt;;lisp part2 concatenate attributes: Bigal &lt;A href="https://www.cadtutor.net/forum/topic/54784-combining-lists/" target="_blank"&gt;https://www.cadtutor.net/forum/topic/54784-combining-lists/&lt;/A&gt;&lt;BR /&gt;(setq lentab (length list2)) ; JW - set number of repetitions as lentab&lt;BR /&gt;(setq x 0) ; JW - set variable x to track number of reps&lt;BR /&gt;(repeat lentab&lt;BR /&gt;(setq anstab (strcat (nth x list2) " SHEET " (nth x list4) " OF " (nth x list5)))&lt;BR /&gt;(setq listtab (cons anstab listtab))&lt;BR /&gt;(setq x (+ x 1))&lt;BR /&gt;) ; end repeat. JW - for each x from 0 to "lentab", concatenate and add to list "listtab"&lt;BR /&gt;(setq listtab (reverse listtab)) ; JW - reverses list to correct order&lt;/P&gt;&lt;P&gt;; JW - this next line might be useless, try deleting this later&lt;BR /&gt;(setvar 'ctab curlayout)&lt;/P&gt;&lt;P&gt;; part 3 - create table style template and generate table, source: INDEXREVDATE.lsp&lt;/P&gt;&lt;P&gt;; create an empty list, set a counter variable, and&lt;BR /&gt;; set a reference to the current model space.&lt;BR /&gt;(setq lst '() i 0)&lt;/P&gt;&lt;P&gt;(setq aobj (vlax-get-acad-object))&lt;BR /&gt;(setq adoc (vla-get-activedocument aobj))&lt;BR /&gt;(setq *ps* (vla-get-paperspace adoc))&lt;BR /&gt;(setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table: "))) ;JW - select insertion point with cursor&lt;/P&gt;&lt;P&gt;(setq acmCol (vla-getinterfaceobject&lt;BR /&gt;(vlax-get-acad-object)&lt;BR /&gt;(strcat "AutoCAD.AcCmColor."&lt;BR /&gt;(substr (getvar "ACADVER") 1 2))))&lt;/P&gt;&lt;P&gt;(setq t_Style1 (vla-item (vla-get-dictionaries adoc) "acad_tablestyle")&lt;BR /&gt;t_Style2 (vla-addObject t_Style1 "CBC_Dwg_Index_Table" "AcDbTableStyle")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(vla-setgridvisibility t_style2 (+ acHorztop acVertleft acVertright)&lt;BR /&gt;(+ acTitlerow):vlax-false)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 41 41 41)&lt;BR /&gt;(vla-put-colorindex acmcol 008)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acVertLeft acHorzTop acVertRight) acTitleRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzInside) acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 0 255 255)&lt;BR /&gt;(vla-put-colorindex acmcol acCyan)&lt;BR /&gt;(vla-setcolor t_style2 acTitleRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzBottom acHorzInside acVertInside) acHeaderRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzBottom acVertLeft acVertRight acVertInside) acDataRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acHeaderRow acmCol)&lt;BR /&gt;(vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setrgb acmCol 0 255 0)&lt;BR /&gt;(vla-put-colorindex acmcol acGreen)&lt;BR /&gt;(vla-setcolor t_style2 acHeaderRow acmCol)&lt;BR /&gt;(vla-setcolor t_style2 acDataRow acmCol)&lt;/P&gt;&lt;P&gt;(vla-setAlignment t_style2 acTitleRow acMiddleCenter)&lt;BR /&gt;(vla-setAlignment t_style2 acHeaderRow acMiddleCenter)&lt;BR /&gt;(vla-setAlignment t_style2 acDataRow acMiddleCenter)&lt;/P&gt;&lt;P&gt;(vla-SetTextHeight t_Style2 acTitleRow 2.5)&lt;BR /&gt;(vla-SetTextHeight t_Style2 acHeaderRow 1.8)&lt;BR /&gt;(vla-SetTextHeight t_Style2 acDataRow 1.8)&lt;BR /&gt;(vla-SetTextStyle t_Style2 acTitleRow "RMS - 2.5mm")&lt;BR /&gt;(vla-SetTextStyle t_Style2 acHeaderRow "RMS - 1.8mm")&lt;BR /&gt;(vla-SetTextStyle t_Style2 acDataRow "RMS - 1.8mm")&lt;BR /&gt;(vla-put-Vertcellmargin t_Style2 0.5)&lt;BR /&gt;(vla-put-Horzcellmargin t_Style2 2)&lt;/P&gt;&lt;P&gt;(setq myTable (vla-AddTable *ps* pt1 (+ 2 (length list1)) 3 7 185)) ;JW - Create table&lt;BR /&gt;(vla-put-StyleName myTable "CBC_Dwg_Index_Table") ;JW - Table style&lt;BR /&gt;(vla-put-layer mytable "N-NOTES") ;JW - Table layer&lt;/P&gt;&lt;P&gt;(vla-setRowHeight mytable 0 5)&lt;BR /&gt;(vla-setRowHeight mytable 1 5)&lt;BR /&gt;(vla-setRowHeight mytable 2 5)&lt;BR /&gt;(vla-setColumnWidth mytable 0 25)&lt;BR /&gt;(vla-setColumnWidth mytable 1 85)&lt;BR /&gt;(vla-setColumnWidth mytable 2 10)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;set the header/title texts&lt;BR /&gt;(vla-setText mytable 0 0 "DRAWING INDEX")&lt;BR /&gt;(vla-setText mytable 1 0 "SHEET NO. / SET")&lt;BR /&gt;(vla-setText mytable 1 1 "SHEET DESCRIPTION")&lt;BR /&gt;(vla-setText mytable 1 2 "ISSUE")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(setq rep1 2) ;JW - variable used to progress table rows&lt;BR /&gt;(setq num 0) ;JW - variable used to get data from lists&lt;/P&gt;&lt;P&gt;(repeat (length list1)&lt;BR /&gt;(vla-setRowHeight mytable rep1 5)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 0 acMiddleLeft)&lt;BR /&gt;(vla-setCellAlignment mytable rep1 1 acMiddleLeft)&lt;BR /&gt;(vla-settext mytable rep1 0 (NTH num LIST1))&lt;BR /&gt;(vla-settext mytable rep1 1 (NTH num LISTtab))&lt;BR /&gt;(vla-settext mytable rep1 2 (NTH num LIST3))&lt;BR /&gt;(setq num (+ num 1))&lt;BR /&gt;(setq rep1 (+ rep1 1))&lt;BR /&gt;); end repeat&lt;/P&gt;&lt;P&gt;;set drawing sheet set row bottom cyan (NOT USED)&lt;BR /&gt;;(vla-mergecells myTable 2 2 0 2)&lt;BR /&gt;;(vla-setCellAlignment mytable 2 0 acMiddleLeft)&lt;BR /&gt;;(vla-setrgb acmCol 0 255 255)&lt;BR /&gt;;(vla-put-colorindex acmcol acCyan)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 0 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 1 acBottomMask acmCol)&lt;BR /&gt;;(vla-setcellgridcolor mytable 2 2 acBottomMask acmCol)&lt;/P&gt;&lt;P&gt;(vlax-release-object aobj)&lt;BR /&gt;(vlax-release-object adoc)&lt;BR /&gt;(vlax-release-object myTable)&lt;BR /&gt;(vlax-release-object *ps*)&lt;/P&gt;&lt;P&gt;(princ)&lt;BR /&gt;); end JW defun&lt;/P&gt;&lt;P&gt;(CBC:dwgindex2)&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 21:27:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109577#M63794</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T21:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109600#M63795</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...only thing i want - layout list not to be sorted&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I do not understand your request. Can you explain in more detail what your issue is and what your questions are? From what you just said, you do NOT want layouts to be sorted. If that is the case, then I do not know what your question is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 21:40:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109600#M63795</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-24T21:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109638#M63796</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BankstownCAD_0-1614203411410.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/885200iC2277E713ACDE34D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BankstownCAD_0-1614203411410.png" alt="BankstownCAD_0-1614203411410.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;See above table sheet list is alphabetically sorted&lt;/P&gt;&lt;P&gt;however my layout shown below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BankstownCAD_1-1614203506243.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/885202i85AF1879F1AE50C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BankstownCAD_1-1614203506243.png" alt="BankstownCAD_1-1614203506243.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to match above layout order with my table sheet list,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 21:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109638#M63796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T21:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109656#M63797</link>
      <description>Do you not use SSM (SheetSet Manager)? What you want is built into that, SSM is all about Layouts.</description>
      <pubDate>Wed, 24 Feb 2021 21:59:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109656#M63797</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2021-02-24T21:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109662#M63798</link>
      <description>&lt;P&gt;My work place doesn't want to use SSM&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 22:02:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109662#M63798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T22:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109750#M63799</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function I provided to you will return a list of the layout names in order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 23:05:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109750#M63799</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-24T23:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109761#M63800</link>
      <description>&lt;P&gt;Many thanks DD for your kind attention,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added your segment &amp;amp; trying to work it out, but not yet getting the expected outcome....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 23:10:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109761#M63800</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T23:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109771#M63801</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you try changing this line..&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(setq list0 (layoutlist)) ;JW - create temp list with all layouts&lt;/LI-CODE&gt;&lt;P&gt;..to this instead?&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(setq list0 (layoutlistordered)) ;JW - create temp list with all layouts&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 23:15:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109771#M63801</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-24T23:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109791#M63802</link>
      <description>&lt;P&gt;Yes, i did so &amp;amp; give me below error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error: no function definition: LAYOUTLISTORDERED&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 23:27:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109791#M63802</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-24T23:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109883#M63803</link>
      <description>Hi DD,&lt;BR /&gt;&lt;BR /&gt;I can provide you my template too, if you want to have a look across?</description>
      <pubDate>Thu, 25 Feb 2021 00:31:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109883#M63803</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-25T00:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109887#M63804</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;error: no function definition: LAYOUTLISTORDERED&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;^^^ This error means that you did not successfully load the function I provided to you.&lt;/P&gt;&lt;P&gt;Are you comfortable with loading lisp files? Please load the lisp function I provided you first, then run your command and see if that works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 00:38:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109887#M63804</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-25T00:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109974#M63805</link>
      <description>&lt;P&gt;I have replaced your code as you said below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BankstownCAD_0-1614216318811.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/885250i6481AF99E97A7809/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BankstownCAD_0-1614216318811.png" alt="BankstownCAD_0-1614216318811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And load the updated Lisp which return with below;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;error: no function definition: LAYOUTLISTORDERED&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did i do it wrong DD?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 01:25:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109974#M63805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-25T01:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110010#M63806</link>
      <description>&lt;P&gt;You must also load &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10109522#M411470" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt; lisp in addition to your lisp.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 01:52:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110010#M63806</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-25T01:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110015#M63807</link>
      <description>&lt;P&gt;Add the Codeding lisp to the start of yours. Then it will get loaded.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 01:57:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110015#M63807</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2021-02-25T01:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110030#M63808</link>
      <description>&lt;P&gt;Thanks DD for helping me through,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No i have new table Sheet Column as per tab order, however sheet descriptions are not following through,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think i lost the connection not sure how to fix,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Monzoor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 02:07:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110030#M63808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-25T02:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110130#M63809</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not tested this code, but it might work for you. Let me know.&lt;/P&gt;&lt;PRE&gt;(defun CBC:DWGINDEX2 ( / errMsg LayoutListOrdered ss e sheetInfo aobj adoc *ps* pt1 acmCol t_Style1 t_Style2 myTable)
  (vl-load-com)

  ;; Initial Check(s)
  (cond
    ((eq "Model" (getvar 'CTAB))
      (setq errMsg "\nYou must be in a layout for this option.")
    );cond 1
    ((not (setq ss (ssget "_X" '((0 . "INSERT") (2 . "CBCRMSA3LAYOUT")))))
      (setq errMsg "\nNo Title Blocks found.")
    );cond 2
  );cond
  ;; Exit if error
  (if errMsg (progn (prompt errMsg) (alert errMsg) (exit)))

  ;; Helper Function(s)
  (defun LayoutListOrdered ( / dLays lays oLays cnt)
    (setq dLays (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_LAYOUT"))))
    (setq lays (mapcar '(lambda (l) (cons (cdr (assoc 71 (dictsearch dLays l))) l)) (layoutlist)))
    (repeat (1- (setq cnt (1+ (length lays))))
      (setq oLays (cons (cdr (assoc (setq cnt (1- cnt)) lays)) oLays))
    );repeat
  );defun
  
  ;; Get attributes/vals from title blocks
  (foreach lay (cdr (layoutlistordered))
    (if (setq ss (ssget "_X" (list (cons 0 "INSERT") (cons 2 "CBCRMSA3LAYOUT") (cons 410 lay))))
      ;; sheetInfo = ((layoutName description issue) ...)
      (setq e (ssname ss 0)
            sheetInfo
              (cons
                (list
                  lay
                  (strcat
                    (getpropertyvalue e "SHEET-DETAILS/CHAINAGE-RANGE")
                    " SHEET "
                    (getpropertyvalue e "1")
                    " OF "
                    (getpropertyvalue e "2")
                  );strcat
                  (getpropertyvalue e "ISSUE")
                );list
                sheetInfo
              );cons
      );setq
    );if
    (setq ss nil)
  );foreach
  (setq sheetInfo (reverse sheetInfo))

  ;; Create table style template and generate table
  (setq aobj (vlax-get-acad-object))
  (setq adoc (vla-get-activedocument aobj))
  (setq *ps* (vla-get-paperspace adoc))
  (initget 1)
  (setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table: ")))

  (setq acmCol
    (vla-getinterfaceobject
      (vlax-get-acad-object)
      (strcat "AutoCAD.AcCmColor." (substr (getvar "ACADVER") 1 2))
    );vla-
  );setq

  (setq t_Style1 (vla-item (vla-get-dictionaries adoc) "acad_tablestyle")
        t_Style2 (vla-addObject t_Style1 "CBC_Dwg_Index_Table" "AcDbTableStyle")
  );setq

  (vla-setgridvisibility
    t_style2
    (+ acHorztop acVertleft acVertright)
    (+ acTitlerow)
    :vlax-false
  );vla-

  (vla-setrgb acmCol 41 41 41)
  (vla-put-colorindex acmcol 008)
  (vla-setgridcolor t_style2 (+ acVertLeft acHorzTop acVertRight) acTitleRow acmCol)
  (vla-setgridcolor t_style2 (+ acHorzInside) acDataRow acmCol)

  (vla-setrgb acmCol 0 255 255)
  (vla-put-colorindex acmcol acCyan)
  (vla-setcolor t_style2 acTitleRow acmCol)
  (vla-setgridcolor t_style2 (+ acHorzBottom acHorzInside acVertInside) acHeaderRow acmCol)
  (vla-setgridcolor t_style2 (+ acHorzBottom acVertLeft acVertRight acVertInside) acDataRow acmCol)
  (vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acHeaderRow acmCol)
  (vla-setgridcolor t_style2 (+ acHorzTop acHorzBottom acVertLeft acVertRight) acDataRow acmCol)

  (vla-setrgb acmCol 0 255 0)
  (vla-put-colorindex acmcol acGreen)
  (vla-setcolor t_style2 acHeaderRow acmCol)
  (vla-setcolor t_style2 acDataRow acmCol)

  (vla-setAlignment t_style2 acTitleRow acMiddleCenter)
  (vla-setAlignment t_style2 acHeaderRow acMiddleCenter)
  (vla-setAlignment t_style2 acDataRow acMiddleCenter)

  (vla-SetTextHeight t_Style2 acTitleRow 2.5)
  (vla-SetTextHeight t_Style2 acHeaderRow 1.8)
  (vla-SetTextHeight t_Style2 acDataRow 1.8)
  (vla-SetTextStyle t_Style2 acTitleRow "RMS - 2.5mm")
  (vla-SetTextStyle t_Style2 acHeaderRow "RMS - 1.8mm")
  (vla-SetTextStyle t_Style2 acDataRow "RMS - 1.8mm")
  (vla-put-Vertcellmargin t_Style2 0.5)
  (vla-put-Horzcellmargin t_Style2 2)

  (setq myTable (vla-AddTable *ps* pt1 (+ 2 (length sheetInfo)) 3 7 185))
  (vla-put-StyleName myTable "CBC_Dwg_Index_Table")
  (vla-put-layer mytable "N-NOTES")
  
  (vla-setRowHeight mytable 0 5)
  (vla-setRowHeight mytable 1 5)
  (vla-setRowHeight mytable 2 5)
  (vla-setColumnWidth mytable 0 25)
  (vla-setColumnWidth mytable 1 85)
  (vla-setColumnWidth mytable 2 10)

  ;set the header/title texts
  (vla-setText mytable 0 0 "DRAWING INDEX")
  (vla-setText mytable 1 0 "SHEET NO. / SET")
  (vla-setText mytable 1 1 "SHEET DESCRIPTION")
  (vla-setText mytable 1 2 "ISSUE")

  (setq cRow 2)
  (foreach sheet sheetInfo
    (vla-setRowHeight mytable cRow 5)
    (vla-setCellAlignment mytable cRow 0 acMiddleLeft)
    (vla-setCellAlignment mytable cRow 1 acMiddleLeft)
    (vla-settext mytable cRow 0 (car sheet))
    (vla-settext mytable cRow 1 (cadr sheet))
    (vla-settext mytable cRow 2 (caddr sheet))
    (setq cRow (+ cRow 1))
  );foreach

  (vlax-release-object aobj)
  (vlax-release-object adoc)
  (vlax-release-object myTable)
  (vlax-release-object *ps*)

  (princ)
);defun

(CBC:DWGINDEX2)&lt;/PRE&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 03:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110130#M63809</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2021-02-25T03:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110138#M63810</link>
      <description>&lt;P&gt;Hi DD,&lt;/P&gt;&lt;P&gt;I had a quick go &amp;amp; it is working the way i wanted&lt;/P&gt;&lt;P&gt;Super thanks to you,&lt;/P&gt;&lt;P&gt;You saved my life &amp;amp; my job,&lt;/P&gt;&lt;P&gt;May Almighty bless you, your family &amp;amp; friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Regards,&lt;/P&gt;&lt;P&gt;Monzoor&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 03:43:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10110138#M63810</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-25T03:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table of layout index lisp, want to display layout list as they were not in order, please help</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10150139#M63811</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5680873"&gt;@CodeDing&lt;/a&gt;&amp;nbsp;and&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I give you both my utmost thanks for your complete code examples.&lt;/P&gt;
&lt;P&gt;Today I managed to write a MT2Table routine to convert an Mtext "table" into a real table by subdividing the entire Mtext string by "\\P" and "/t".&amp;nbsp; The beauty is that a lot of our work requires tabulating lot coverages, and although I wrote a routine to total the square footage in an Mtext object, getting the total in the table will be more reliable.&amp;nbsp; Well, except that the quantities contain commas, as in "2,475 SF."&amp;nbsp; I'll have to study what that solution might be.&lt;/P&gt;
&lt;P&gt;Anyway, the most important thing is that I learned a lot from you guys.&amp;nbsp; YAY!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 23:36:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-a-table-of-layout-index-lisp-want-to-display-layout/m-p/10150139#M63811</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-03-11T23:36:54Z</dc:date>
    </item>
  </channel>
</rss>

