求助大神!换行问题!
(defun c:Q (/ SS FF I ent e1 ey sel)(if (and (setq SS (ssget '((0 . "*TEXT")))) (if (findfile "d:\\ABC.csv") (setq FF (open "d:\\ABC.csv" "a")) (setq FF (open "d:\\ABC.csv" "w")) ) ) (progn (setq I-1 selnil ) (repeat (sslength SS)(setq i (1+ i) ent (entget (ssname ss i)) e1(cdr (assoc 1 ent)) ey(caddr (assoc 10 ent)) sel (cons (list e1 ey) sel)) ) (setq sel (vl-sort sel '(lambda (y1 y2) (> (cadr y1) (cadr y2))))) (mapcar '(lambda (e) (princ e FF) (princ "\n" ff) ) (mapcar 'car sel) ) (close ff) ))(princ))
以上程序来自 li_j 老师,我试着修改了一下你这个程序,导出到记事本。浩辰可以正常换行,但是中望就不行了,没有实现换行,程序里面明明有换行符,可是为什么不行呢?出现这种情况的原因是啥?不知哪位大侠能否指教?谢谢。
(defun c (/ SS FF I ent e1 ey sel)
(if (and (setq SS (ssget '((0 . "*TEXT"))))
(if (findfile "d:\\ABC.csv")
(setq FF (open "d:\\ABC.csv" "a"))
(setq FF (open "d:\\ABC.csv" "w"))
)
)
(progn (setq I -1
sel nil
)
(repeat (sslength SS)
(setq i (1+ i)
ent (entget (ssname ss i))
e1(cdr (assoc 1 ent))
ey(caddr (assoc 10 ent))
sel (cons (list e1 ey) sel)
)
)
(setq sel (vl-sort sel '(lambda (y1 y2) (> (cadr y1) (cadr y2)))))
(mapcar '(lambda (e) (princ e FF) (princ "\n" ff))
(mapcar 'car sel)
)
(close ff)
)
)
(princ)
)
这是什么? liuhe 发表于 2022-11-15 10:59
(defun c (/ SS FF I ent e1 ey sel)
(if (and (setq SS (ssget '((0 . "*TEXT"))))
(if (findfile ...
大侠,貌似你这个没有变化啊?还是不能换行。
已解决,谢谢!
本帖最后由 suiran 于 2022-11-15 15:01 编辑已解决,谢谢!
页:
[1]