麻烦哪位大神帮改一下导出单行文字代码
(defun c:yhb()(if (= (setq n (getint "\n保存文字时每行的个数<1>:")) niL)
(setq n 1)
)
(princ "\n请选择单行文字:")
(if (setq ssa (ssget '((0 . "text"))))
(if (setq wjm(getfiled "请指定提取结果存盘文件" "C:\Users\ooxx\Documents\AAAA" "csv" 1))
(progn
(setq m (sslength ssa)
i 0
zfc ""
ff (open wjm "w")
j 0
)
(repeat m
(setq dxf (entget (ssname ssa i))
i (1+ i)
wz(cdr (assoc 1 dxf))
j (1+ j)
)
(if (= j n)
(progn
(setq zfc (strcat zfc wz "\n"))
(princ zfc ff)
(princ zfc)
(setq zfc "" j 0)
)
(setq zfc (strcat zfc wz ","))
)
)
(if (< 0 j n)
(progn
(setq zfc (substr zfc 1 (1- (strlen zfc)))
zfc (strcat zfc "\n")
)
(princ zfc ff)
(princ zfc)
)
)
(close ff)
)
(princ "\n没有指定提取结果存盘文件")
)
(princ "\n没有选取任何单行文字!")
)
(princ)
)
以上是可以导出选中的单行文字,但是同一个文字点选多次也只导出一个,我想点多少次就导出多少个,重复的也要导出来,谢谢老师。
页:
[1]