;;别人的东西又不是为你的需求写的,自己改改呗
;;给你个单行文字的,多行文字的参照我给你的链接改改
- (defun c:test1 ( / t_ss ffn opf n)
- (setq t_ss (ssget ":N" (list(cons 0 "TEXT"))))
- (if t_ss
- (progn
- (setq ffn (getfiled "输出选中文本:" (getvar "dwgprefix") "csv" 1))
- (setq opf (open ffn "w"))
- (setq n 0 m (sslength t_ss))
- (repeat m
- (write-line (cdr(assoc '1 (entget (ssname t_ss n)))) opf)
- (setq n (1+ n))
- )
- (close opf)
- (alert (strcat "\n所选文本已写入: " ffn))
- )
- (princ "未选中可导出文本!")
- )
- (princ)
- )
|