写得很快:
- (defun c:txtin ( / csv des ins lst str )
- (if (and (setq csv (getfiled "Select CSV File" "" "*" 0))
- (setq des (open csv "r"))
- )
- (progn
- (while (setq str (read-line des))
- (while (vl-string-position 44 str)
- (setq str (vl-string-subst """" "," str))
- )
- (if (and (setq lst (read (strcat "("" str "")")))
- (setq ins (mapcar 'distof lst '(2 2)))
- (caddr lst)
- )
- (entmake (list '(0 . "TEXT") '(40 . 2.0) (cons 10 ins) (cons 1 (caddr lst))))
- )
- )
- (close des)
- )
- )
- (princ)
- )
|