各位大佬好,我想将CAD获取的多个文字数据导出到csv,但是能力不够,求大佬完善一下我的代码
- (defun c:tt()
- (command "._undo" "_begin")
- (setq k 0)
- (setq tag 0)
- (setq s (ssget))
- (setq nu (sslength s))
- (while (< k nu)
- (setq en (entget (setq a (ssname s k))))
- (setq k (+ k 1))
- (if (= (cdr (assoc 0 en)) "TEXT")
- (progn
- (SETQ d1((cdr (assoc 1 en)))
-
- (setq tag (+ tag 1))
- ))
- ))
- (setq f (open "C:/Users/Administrator/Desktop/1.csv" "a" ))
- (write-line f)
- (close f))
想要的效果
|