- (defun c:tt ()
- (setq i 0)
- (princ "\n选择需输出坐标的文字: ")
- (if (and (setq ss (ssget '((0 . "text"))))
- (setq ff (open (getfiled "文件保存为" "" "dat" 1) "w"))
- )
- (repeat (sslength ss)
- (setq en (entget (ssname ss i))
- sn (itoa (1+ i))
- pt (cdr (assoc 10 en))
- x (rtos (cadr pt) 2 4)
- y (rtos (car pt) 2 4)
- z (cdr (assoc 1 en))
- z (if (setq n(vl-string-search "\n" z))(substr z 1 n)z)
- i (1+ i)
- )
- (write-line (strcat sn "," y "," x "," z) ff);sn是序号
- )
- )
- (princ)
- )
|