Here is a quick framework of what you
need just for testing
Text file should created in the same folder
with name Manholes.txt
Comments?
~'J'~
;;copy this code and save as wtx.lsp
(defun C:wtx (/ accum bn elist en i ss tmpstr tot txtfile txtname xc xstr yc ystr)
(setq ss (ssget (list (cons 0 "INSERT")(cons 66 1))) i -1)
(repeat (sslength ss)
(setq en (ssname ss (setq i (1+ i))))
(setq elist (entget en)
xc (car (cdr (assoc 10 elist)))
yc (cadr (cdr (assoc 10 elist)))
bn (cdr (assoc 2 elist))
xstr (rtos xc 3 3); in arch. units, must be (rtos xc 2 3) in dec. units
ystr (rtos yc 3 3); in arch. units, must be (rtos yc 2 3) in dec. units
tmpstr (strcat bn "," xstr "," ystr)
accum (cons tmpstr accum)
)
)
(setq accum (vl-sort accum '<))
(setq txtname (strcat (getvar "dwgprefix") "\\Manholes.txt") i 0 tot 0); <-- change text name to your suit
(setq txtfile (open txtname "a")); open text file for appending
(write-line (strcat "Drawing: " (strcat (getvar "dwgprefix")(getvar "dwgname"))) txtfile)
(write-line "------------------------------------------" txtfile)
(foreach itm accum
(write-line itm txtfile)
)
(write-line "------------------------------------------" txtfile)
(close txtfile)
)
(princ "\n Start command line with WTX...")
(princ)