Do you need code to get all the parts and add them to a list with quantities?
Assuming you already have that, and your list is in the format:
(list
'("\(L2x1000...……..2000\)" "20")
'("\(L3x1100...……..2100\)" "40")
)
You can use this create and fill a table. I've put variable values in square brackets.
(setq *ms* (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setq myTable (vla-AddTable *ms* (vlax-3d-point pt) (+ 2 (length lst)) 2 24 120)) ; makes a table with as many rows as length lst plus two for the title and headers, 2 columns, row height 24 and cell width 120
(vla-setcelltextheight myTable 0 0 18) ; title text height 18, to stand out
(setq y 1)
(repeat (1+ (length lst))
(setq x 0)
(repeat 2 ; adjust for number of columns
(vla-setcelltextheight myTable x y 12) ; cell text height 12
(vla-setCellAlignment myTable x y 5) ; cell alignment middle center
(setq x (1+ x))
)
(setq y (1+ y))
)
(vla-setText mytable 0 0 "Parts") ; fill in title
(vla-setText mytable 1 0 "Description") ; fill in header
(vla-setText mytable 1 1 "Quantity") ; fill in header
(setq row 2)
(foreach item lst
(vla-setText mytable row 0 (car item)) ; fill in description
(vla-setText mytable row 1 (last item)) ; fill in quantity
(setq row (1+ row))
)
(vlax-release-object myTable)
(vlax-release-object *ms*)
This is modified slightly from some code I use myself. It also assumes units are inches, which I mention since you put mm in your descriptions. You'll need to adjust for different units settings.