这是一个写列的文字lisp应该是一个很好的起点,而不是写到文件只是调用pline和使用每个新的pt需要使用vl排序列表,虽然在做pline之前。通过比例因子调整x?
- ; converts column of text to comma seprated file with text value and y value
- ; put in excell and sort by y value
- ; by Alan H Nov 2004
- (setq x 1)
- (while (/= x 4)
- (setq howmany (rtos x 2 0))
- (setq fileto (strcat "c:/temp/setout" howmany))
- (princ fileto)
- (setq fout (open fileto "w"))
- (while (not (setq ss (ssget ))))
- (princ "wow")
- (while (setq en (ssname ss 0))
- ; Entity type
- (setq entyp (cdr (assoc 0 (entget en))))
- (princ "wow")
- (if (= entyp "TEXT")
- (progn
- (setq xyz (cdr (assoc 10 (entget en))))
- (setq txtht (cdr (assoc 1 (entget en))))
- ;write file out here
- (setq textout (strcat txtht "," (rtos (cadr xyz) 2 3)))
- ;write
- (write-line textout fout)
- (princ textout)
- )
- )
- ; Delete each measured entity from set
- (ssdel en ss)
- ;end while
- )
- (close fout)
- (setq x (+ x 1))
- ) ;end if loop 3 times
- (princ)
|