ttt.lsp
;; free lisp from cadviet.com
;;; this lisp was downloaded from http://www.cadviet.com/forum/topic/98743-nho-viet-lisp-xuat-text-tu-cad-sang-excel-dang-cot-theo-thu-tu-chon/
(defun LM:writecsv ( lst csv / des sep )
(if (setq des (open csv "w"))
(progn
(setq sep (cond ((vl-registry-read "HKEY_CURRENT_USER\\Control Panel\\International" "sList")) (",")))
(foreach row lst (write-line (LM:lst->csv row sep) des))
(close des)
t
)
)
)
(defun LM:lst->csv ( lst sep )
(if (cdr lst)
(strcat (LM:csv-addquotes (car lst) sep) sep (LM:lst->csv (cdr lst) sep))
(LM:csv-addquotes (car lst) sep)
)
)
(defun LM:csv-addquotes ( str sep / pos )
(cond
( (wcmatch str (strcat "*[`" sep "\"]*"))
(setq pos 0)
(while (setq pos (vl-string-position 34 str pos))
(setq str (vl-string-subst "\"\"" "\"" str pos)
pos (+ pos 2)
)
)
(strcat "\"" str "\"")
)
( str )
)
)
(defun C:ttt(/ lst ss i el x fn)
(setq lst (list) ss (ssget (list (cons 0 "TEXT"))) )
(repeat (setq i (sslength ss))
(setq x (ssname ss (setq i (1- i))))
(setq el (entget x))
(if (= (cdr (assoc 0 el)) "TEXT")
(setq lst (append lst (list (list (cdr (assoc 1 el))))))
)
)
(setq fn (vl-filename-mktemp nil nil ".csv"))
(if (and lst (LM:WriteCSV (reverse lst) fn))
(startapp "explorer" fn)
)
)
2D 나무 심볼 모음 (0) | 2021.11.09 |
---|---|
임의의 점에서 원이나 호에 접하는 선 그리기 (0) | 2021.11.09 |
Exporting Dimensions to Excel (0) | 2021.11.05 |
객체 교차점을 끊는 LISP BreakObjects.lsp (0) | 2021.10.20 |
layer on off (0) | 2021.10.20 |