- (defun c:tt1( / ffn ff ss i ii ssn endata n pp key x_temp y_temp x y iii )
- (setvar "cmdecho" 0)
- (setq ffn (vl-filename-mktemp "d:\\$.txt"))
- (princ "\n选取PLINE多义线...")
- (setq ss (ssget))
- (setq i 0)
- (setq ii 1) ;;输出点号
- (setvar "pdmode" 33)
- (repeat (sslength ss)
- (setq ssn (ssname ss i))
- (setq endata (entget ssn))
- (setq n 0)
- (repeat (length endata)
- (setq pp (nth n endata))
- (setq key (car pp))
- (if (= key 10)
- (progn
- (setq x_temp (cadr pp))
- (setq y_temp (caddr pp))
- (setq x (rtos x_temp 2 4)) ;;把x后小数点变为四位输出
- (setq y (rtos y_temp 2 4)) ;;把y后小数点变为四位输出
- (setq iii (itoa ii))
- (setq ff (open ffn "a"))
- (princ iii ff)
- (princ "," ff)
- (princ x ff)
- (princ "," ff)
- (princ y ff)
- (princ "\n" ff)
- (close ff)
- (setq ii (1+ ii))
- )
- )
- (setq n (1+ n))
- )
- (setq ii ii)
- (setq i (1+ i))
- )
- (princ)
- )
|