I have read a csv create a table if you want it. But easier is make a table the 1st 3 rows heading, description, data etc then when you write line to csv just do a insertrows to table very easy.
; Example of how to create an Autocad Table
; By Alan H
(defun AHMaketable (/ colwidth numcolumns numrows objtable rowheight sp vgad vgao vgms)
(vl-load-com)
(setq sp (vlax-3d-point (getpoint "\nPick 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")
(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)
)
(AHMaketable)
(princ "\n")
(setq n 2 txtht 45)
( AH:table_make 2 n txtht 400)
(setq objtable (vlax-ename->vla-object (entlast)))
would do the write line now do
(vla-insertrows objtable (setq n (1+ n)) (* txtht 2.0) 1)
(vla-settext objtable (1+ n) 0 val1)
(vla-settext objtable (1+ n) 1 val2)
(vla-settext objtable (1+ n) 1 val2)
(vla-setrowheight objtable (1+n) (* txtht 2.0))
)
This is not true code but example call (ahmaketable) 1st then the insertrows.
Oh yeah if table is huge make sure tableregenerate :vlax-false else will grind to a halt.