各位高手请帮我解决一下CAD坐标输出位数不够的问题。我的程序是想把CAD里的多义线坐标输出并在CAD里各点加上一个记号。但输出时坐标位数不够。如CAD图里的坐标是(1000.1234567890,2000.0987654321),输出到TXT文件时却成了1000.12 2000.09
我的程序如下:
(defun c:zb()
(setvar “cmdecho” 0)
(setq ffn (getfiled “选取文件” “” “txt” 1))
(setq ff (open ffn “w”))
(close ff)
(setq ss (ssget “\n选择多义线”)
(setq I 0)
(setvar “pdmode” 33)
(repeat (sslength ss)
(setq name (ssname ss I))
(setq e (entget name))
(setq n 0)
(repeat (length e)
(setq pp (nth n e ))
(setq key (car pp))
(if (= key 10)
(progn
(setq x (cadr pp))
(setq y (caddr pp))
(command “point” (list x y))
(setq ff (open ffn “a”))
(princ x ff)
(princ “ “ ff)
(princ x ff)
(princ “\n” ff)
(close ff)
)
)
(setq n (1+ n ))
)
(setq ff (open ffn “a”))
(princ “end\n” ff)
(close ff)
(setq I (1+ I ))
)
)
请各位高手帮我解决一下,本个不胜感激!! |