(defun c:txtout (/ fln f a n index el e txt) (setq fln (getstring "\n输出文件名:")) (setq fln (strcat fln ".txt")) (setq f (open fln "w")) (setq a (ssget)) (setq n (sslength a)) (setq index 0) (repeat n (setq el (entget ( ssname a index))) (setq index ( + index 1)) (setq e (assoc 0 el)) (if (= "TEXT" (cdr e)) (progn (setq txt (cdr (assoc 1 el))) (write-line txt f) ) ) ) (close f) )
可以输出文件到文件中