原来你在选择节点号那里就要退出了,这是一个十分简单的程序结构问题,你不应该写不出来啊,,,,给你稍微改了一下:- (defun c:cadtofile ()
- (setvar "cmdecho" 0)
- (princ "\n----------<<坐标点输出到文件 >>------------")
- (setq ffn (getfiled "写出文件" "" "txt" 1))
- (setvar "pdmode" 34)
- (setq ff (open ffn "w"))
- (close ff)
- (while (setq txt (entsel "\n选择节点号: "))
- (setq txt (entget (car txt)))
- (setq txt (assoc 1 txt))
- (setq txt (cdr txt))
- (setq pt (getpoint "\n节点位置: "))
- (setq ff (open ffn "a"))
- (princ txt ff)
- (princ " " ff)
- (princ (car pt) ff)
- (princ " " ff)
- (princ (cadr pt) ff)
- (princ " " ff)
- ;;(princ (caddr pt) ff)
- (princ "\n" ff)
- (close ff)
- )
- (princ (strcat "\n写出文件: " ffn))
- (prin1)
- )
|