<?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: Autolisp - Data Handling &amp;amp; Creating Tables with Autocad LT in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13159418#M6251</link>
    <description>&lt;P&gt;Hi there, yes its LT 2025&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; so luckily autolips functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2024 07:50:59 GMT</pubDate>
    <dc:creator>traci_haberghamJQEJT</dc:creator>
    <dc:date>2024-11-19T07:50:59Z</dc:date>
    <item>
      <title>Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13150055#M6247</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Please could I have some advice on the best way to approach what I am wanting to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our drawings contain area blocks which contain attributes containing the name and areas (m2 &amp;amp; ft2).&amp;nbsp; I am wanting to schedule these into tables but will need to analyse the data first so the right information goes in the right table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At present we use the same block (existing and proposed areas).&amp;nbsp; This could change to ease the data handling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then need to filter the information into Gross/NIA Areas (existing and proposed) and General Areas (existing and proposed).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would I be best extracting this information to a csv file, sorting out the tables in there and importing the tables into Autocad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data handling when selecting the blocks and creating a table from that data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(this data will be updated from time to time so need the ability to either update or regenerate a table).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My programming skills aren't the best, I already have the extract csv file set up but just checking the best way to approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, Traci&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 10:20:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13150055#M6247</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-15T10:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13154015#M6248</link>
      <description>&lt;P&gt;I tried something I have and got this is it what you want ?&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="SeaHaven_0-1731731608929.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1434484iA5E3226E8C05130E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1731731608929.png" alt="SeaHaven_0-1731731608929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:33:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13154015#M6248</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-16T04:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13156574#M6249</link>
      <description>&lt;P&gt;Yes that's exactly what I want but just columns B, C &amp;amp; D.&amp;nbsp; Is it easy to do?&amp;nbsp; Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 07:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13156574#M6249</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-18T07:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13158340#M6250</link>
      <description>&lt;P&gt;You say have LT is it 2024+ as that has lisp functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image was created by a out of box code but it could be modified for column order and number of columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please answer LT question.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 21:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13158340#M6250</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-18T21:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13159418#M6251</link>
      <description>&lt;P&gt;Hi there, yes its LT 2025&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; so luckily autolips functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 07:50:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13159418#M6251</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-19T07:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13169098#M6252</link>
      <description>&lt;P&gt;Been on holidays so added to my to do list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back again try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:wow ( / AH:table_make att atts lst lst2 obj obj2 ss txtsz total val)

(defun AH:table_make (numrows numcolumns  txtht /  curspc colwidth numcolumns  objtable rowheight sp doc)
 ;; Get the Dictionaries collection and the TableStyle dictionary
 (setq dicts (vla-get-Dictionaries (vla-get-ActiveDocument(vlax-get-acad-object))))
 (setq dictObj (vla-Item dicts "acad_tablestyle"))
 (setq tabname (strcat "TXT" (rtos txtsz 2 2)))
 (vlax-for dname dictobj
 (if (=  (vla-get-name dname) tabname) ; does it exist
 (princ "\nfound")
 (progn

;; Create a custom table style
(setq key tabname class "AcDbTableStyle")
(setq custObj (vla-AddObject dictObj key class))

;; Set the name and description for the style
(vla-put-Name custObj tabname)
(vla-put-Description custObj tabname)

;; Sets the bit flag value for the style
(vla-put-BitFlags custObj 1)

;; Sets the direction of the table, top to bottom or bottom to top
(vla-put-FlowDirection custObj acTableTopToBottom)

;; Sets the horizontal margin for the table cells
(vlax-put  custObj 'HorzCellMargin txtht)

;; Sets the vertical margin for the table cells
(vlax-put custObj 'VertCellMargin txtht)

;; Set the alignment for the Data, Header, and Title rows
(vla-SetAlignment custObj (+ acDataRow acHeaderRow acTitleRow) acMiddleCenter)

;; Set the text height for the Title, Header and Data rows
(vla-SetTextHeight custObj acDataRow txtht)
(vla-SetTextHeight custObj acHeaderRow (* txtht 1.2))
(vla-SetTextHeight custObj acTitleRow (* txtht 1.5))
  
   ;; Set the text height and style for the Title row
(vla-SetTextStyle custObj (+ acDataRow acHeaderRow acTitleRow) "Standard")
  
)
)
)
(setvar 'ctablestyle tabname)
(princ)
)

(setq txtsz (getreal "Enter text size "))
(setq sp (vlax-3d-point (getpoint "Pick top left")))

(setq doc  (vla-get-activedocument (vlax-get-acad-object) ))
(if (= (vla-get-activespace doc) 0)
  (setq  curspc (vla-get-paperspace doc))
  (setq curspc (vla-get-modelspace doc))
)

(setq numrows 3 numcolumns 3)
(setq rowheight txtsz)
(setq colwidth 10)

(AH:table_make 3 3 txtsz)

(setq objtable (vla-addtable curspc sp numrows numcolumns rowheight colwidth))
(vla-settext objtable 0 0 "TABLE title")
(vla-settext objtable 1 0 "Room Name")
(vla-settext objtable 1 1 "m²")
(vla-settext objtable 1 2 "Sq Ft")

(setq obj2 (vlax-ename-&amp;gt;vla-object (entlast)))
(vla-setcolumnwidth obj2 0 (* txtsz 38))
(vla-setcolumnwidth obj2 1 (* txtsz 10))
(vla-setcolumnwidth obj2 2 (* txtsz 10))
(vla-setRowHeight obj2 1 (* txtsz 2.0))

(setq ss (ssget '((0 . "insert"))))

(setq lst '())
(repeat (setq  x (sslength ss))
  (setq lst2 '())
  (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss (setq x (- x 1)))))
  (if  (= (vla-get-hasattributes obj) :vlax-true)
   (progn
   (setq atts (vlax-invoke obj "getattributes"))
   (setq lst2 (cons (vla-get-EffectiveName obj) lst2))
   (foreach att atts
    (setq lst2 (cons (vla-get-textstring att) lst2))
   )
   (setq lst (cons (reverse lst2) lst))
   )
   (progn
    (setq lst (cons (list (vla-get-EffectiveName obj)) lst))
   )
  )
)

(setq lst (vl-sort lst '(lambda ( a b ) (&amp;lt; (cadr a) (cadr b)))))
(setq tot1 0.0 tot2 0.0)
(foreach val lst
(setq tot1 (+ (atof (nth 4 val)) tot1))
(setq tot2 (+ (atof (nth 5 val)) tot2))
)

(setq rownum 2)
(foreach val lst
(vla-InsertRows obj2  rownum  (vla-GetRowHeight obj2 (- rownum 1)) 1)
(vla-settext obj2 rownum  0 (nth 1 val))
(vla-settext obj2 rownum  1 (nth 4 val))
(vla-settext obj2 rownum  2 (nth 5 val))
(setq rownum (1+ rownum))
)
(vla-InsertRows obj2  rownum  (vla-GetRowHeight obj2 (- rownum 1)) 1)
(vla-settext obj2 rownum  1 "Total")
(vla-settext obj2 rownum  1 (strcat (rtos tot1 2 3) " m²"))
(vla-settext obj2 rownum  2 (strcat (rtos tot2 2 3) " ft²"))
(princ)
)
(c:wow)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 01:03:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13169098#M6252</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-27T01:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13171826#M6253</link>
      <description>&lt;P&gt;Thank you, and hope you had a nice holiday&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes that's great.&amp;nbsp; Sorry just one more questions - is it easy to add totals to columns?&amp;nbsp; If so, where do I look for the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your amazing work and help on this, it is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 09:12:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13171826#M6253</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-25T09:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13173843#M6254</link>
      <description>&lt;P&gt;When you say totals what do you mean ? A master total or a count of items that have similar values ? ie room names the same, the sq m the same. Could be done that was what I did with the out of box answer but there were no duplicates of room name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 04:43:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13173843#M6254</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-26T04:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13174127#M6255</link>
      <description>&lt;P&gt;The area totals of the number columns.&amp;nbsp; As the elements are added to the ss, would you add the values to a figure at that point?&amp;nbsp; Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 07:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13174127#M6255</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-26T07:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13176098#M6256</link>
      <description>&lt;P&gt;Ok I updated the code above a quick fix I also changed to the area values with no sq.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 01:04:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13176098#M6256</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-27T01:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Autolisp - Data Handling &amp; Creating Tables with Autocad LT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13181245#M6257</link>
      <description>&lt;P&gt;Thank you, I will have a look and learn from how you've added the totals.&amp;nbsp; Much appreciated and a massive thank you&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 09:10:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-data-handling-amp-creating-tables-with-autocad-lt/m-p/13181245#M6257</guid>
      <dc:creator>traci_haberghamJQEJT</dc:creator>
      <dc:date>2024-11-29T09:10:51Z</dc:date>
    </item>
  </channel>
</rss>

