Here's a quick-n-dirty way of doing it.
(defun c:aecc2csv ( /
; local functions
GetFileName XY2NE
; local vars
cntr fo aecc_ss ent kwd
)
;;; *** warning do not use this if you have changed the north
;;; *** rotation
;;; convert all AECC_POINTS that are inserted in the current
;;; dwg to a comma deleimited ascii file with a format of
;;; PN,N,E,Z,DESC.
;;;
;;; you are given the option of removing the points once the
;;; file has been created.
;;;
;;; Copyright© 2005 Mark S. Thomas
;;; Mark S. Thomas ( mark@theswamp.org )
(setq cntr 0)
(defun GetFileName ( / file2open)
(setq file2open
(getfiled
"Select text file to open"
"c:\\temp\\" ; **you might want to change this**
"txt"
1
)
)
)
;; convert a point list to comma delimited string
;; Y before X
(defun XY2NE (lst)
(strcat
(rtos (cadr lst))
","
(rtos (car lst))
)
)
(if (setq fn (GetFileName))
(setq fo (open fn "w"))
(exit)
)
(if (setq aecc_ss (ssget "X" '((0 . "AECC_POINT"))))
(while (setq ent (ssname aecc_ss cntr))
(write-line
(strcat
(itoa (cdr (assoc 90 (entget ent)))) ; point number
","
(XY2NE (cdr (assoc 11 (entget ent))))
","
(rtos (car (reverse (assoc 11 (entget ent))))) ; elev
","
(cdr (assoc 303 (entget ent))) ; description
)
fo
)
(setq cntr (1+ cntr))
)
)
(close fo)
(princ)
(initget "Yes No")
(setq kwd (getkword "\nDelete AECC Points [Yes/No]: "))
(cond ((= kwd "Yes")
(setq cntr 0)
(while (setq ent (ssname aecc_ss cntr))
(entdel ent)
(setq cntr (1+ cntr))
)
(princ (strcat "\n"(itoa (sslength aecc_ss)) " points removed"))
)
(T (princ))
)
(princ)
)
** changed from DXF code 10 to 11 ***