Did you google pline to table should be out there already.
Right table much easier, the code provided above is maybe an over kill.
Just need a parse csv to make a list of txt file. Re Lee-mac
(Distance (list x1 y1)(list x2 y2)) use the nth function for 1-2 2-3 3-4 use (repeat (- (length lst) 1 then do last 4-1, can also do a trick copy 1st xy to list as a close.
Here is a sample make table to get you started. You need a merge cells function for last 2 lines (vla-mergecells tblobj minrow maxrow mincol maxcol)
; make table example
; By Alan H info@alanh.com.au
; 2018
(defun c:ahmaketable (/ colwidth numcolumns numrows objtable rowheight sp vgad vgao vgms)
(vl-load-com)
(setq sp (vlax-3d-point (getpoint "pick a point for table")))
(Setq vgms (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) ;
(setq numrows 5)
(setq numcolumns 5)
(setq rowheight 2.5)
(setq colwidth 60)
(setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth))
(vla-settext objtable 0 0 "DRAWING REGISTER"); TABLE TITLE
(vla-settext objtable 1 0 "DRAWING NUMBER")
(vla-settext objtable 1 1 "DRAWING TITLE")
(vla-settext objtable 1 2 "C")
(vla-settext objtable 1 3 "D")
(vla-settext objtable 1 4 "E")
(vla-settext objtable 2 0 "1")
(vla-settext objtable 3 0 "2")
(vla-settext objtable 4 0 "3")
(command "_zoom" "e")
(princ)
)
[\code]