Hi,
Something like this?
(defun c:Test (/ *error* int sel ent get ovr csv opn )
;; Tharwat - 29.Jul.2021 ;;
(defun *error* (msg)
(and opn (close opn))
(and msg (not (wcmatch (strcase msg) "*CANCEL*,*EXIT*,*BREAK*")) (princ (strcat "\nError =>: " msg)))
(princ "\nThis AutoLISP program was written by Tharwat Al Choufi")
)
(and (setq int -1 sel (ssget '((0 . "*DIMENSION"))))
(setq csv (getfiled "Save as ..." (getvar 'DWGPREFIX) "csv" 1))
(setq opn (open csv "w"))
(write-line (strcat "Text Override" "," "Measurement") opn)
(while (setq int (1+ int) ent (ssname sel int))
(setq get (entget ent))
(write-line
(strcat (if (= (setq ovr (cdr (assoc 1 get))) "") "Null" ovr)
","
(vl-princ-to-string (cdr (assoc 42 get))))
opn
)
)
)
(*error* nil)
(princ)
) (vl-load-com)