关于autocad点的坐标
我想描等直线图从而得到很多组点的坐标,但是一个一个记录太麻烦了,用LIST命令也比较麻烦,有没有办法把这些点的坐标直接自动形成一个坐标文件? <p>仅仅是个例子</p><p>(defun C:DR (/ cdate rq ct named filename name f s aa a z )<br/>(setq named (vl-filename-base (getvar "dwgname")))<br/>(setq filename (getvar "dwgprefix"))<br/>(setq name (strcat filename named "点.dat"))<br/> (setq S (ssget (list (cons 0 "POINT"))))<br/>(if s (progn<br/>(setq f (open name "W"))<br/>(setq aa (itoa (sslength s)))<br/>(princ aa f)<br/>(princ "\n" f)<br/>(setq a 0)<br/>(repeat (sslength s)<br/>(setq z (entget (ssname s a)))<br/>(setq pt1 (cdr (assoc 10 z)))<br/>(setq z1 (caddr pt1))<br/>(setq x1 (rtos (car pt1) 2 3 ))<br/>(setq y1 (rtos (cadr pt1) 2 3 ))<br/>(setq n (+ a 1))<br/>(princ n f)<br/>(princ ",," f)<br/>(princ x1 f)<br/>(princ "," f)<br/>(princ y1 f)<br/>(princ "," f)<br/>(princ z1 f)<br/>(princ "\n" f)<br/>(setq a (1+ a ))<br/>)<br/>(close f)<br/>(princ (strcat "一共有" (itoa a) "个点写入" name "文件内。"))<br/>(princ)<br/>)(alert"选择集不存在或输入有误!"))<br/>)</p>
页:
[1]