@Joe.Gio ,
This SHOULD be able to do it for you. The slow part will be updating any necessary dwg paths.
What this does is exports ALL tables in a drawing, to a SINGLE csv. Then subsequent drawing tables ALSO get added to the SINGLE csv.
Here's the script file you can use (update the lisp location and dwg locations):
FILEDIA
0
OPEN
c:/users/username/desktop/drawing1.dwg
(load "c:\\users\\username\\desktop\\cte.lsp")
CTE
CLOSE
OPEN
c:/users/username/desktop/drawing2.dwg
(load "c:\\users\\username\\desktop\\cte.lsp")
CTE
CLOSE
OPEN
c:/users/username/desktop/drawing3.dwg
(load "c:\\users\\username\\desktop\\cte.lsp")
CTE
CLOSE
FILEDIA
1
And here's the lisp file you will use (be sure to update the file path to wherever you need). You said you needed all tables in ONE csv, so this will do that.
(defun c:CTE ( / ss fName f cnt e tbl r c cR cC tmp txt)
;CustomTableExport
(if (not (setq ss (ssget "_X" '((0 . "ACAD_TABLE")))))
(progn (alert "No Tables Found") (exit))
);if
(setq fName "c:\\users\\username\\desktop\\CustomTableExport.csv")
(if (setq f (open fName "a"))
(progn
(repeat (setq cnt (sslength ss))
(setq e (ssname ss (setq cnt (1- cnt))))
(write-line (strcat (getvar 'DWGNAME) " - Table " (itoa (1+ cnt))) f)
(setq tbl (vlax-ename->vla-object e))
(setq r (vla-get-rows tbl) c (vla-get-columns tbl))
(setq cR 0)
(repeat r
(setq cC 0 txt "")
(repeat c
(setq tmp (vlax-variant-value (vlax-variant-change-type (vla-getcellvalue tbl cR cC) 8)))
(if (= (1- c) cC)
(progn (setq txt (strcat txt (if tmp tmp ""))) (write-line txt f))
(setq txt (strcat txt (if tmp tmp "") ","))
);if
(setq cC (1+ cC))
);repeat c
(setq cR (1+ cR))
);repeat r
);repeat cnt
(close f)
);progn
);if
(prompt "\nCTE Complete..")
(princ)
);defun
Hope this helps! Best,
~DD