这是一个从网上下载的提取点号和坐标的程序,现在是圈点坐标,如何改为点选坐标
新手对此不懂请大家 帮忙指点谢谢了
(defun c:plzbsc()
(princ "\n选择所需输出的点(point):")
(setq ss (ssget ));;选取坐标点
(setq n (sslength ss ));计算坐标点数量
(setq ff (open (getfiled "文件保存为" "C:/" "txt" 1) "w"));保存路径
(setq i 0)
(repeat n
(setq spt (ssname ss i ))
(setq ept (entget spt))
(if (= (cdr (assoc 0 ept)) "POINT")
(progn
(setq lxy (cdr (assoc 10 ept)))
(setq sx (rtos (nth 1 lxy)));将坐标值实数转换成字符
(setq sy (rtos (nth 0 lxy)))
(setq i1 (+ i 1));计算点序号
(setq sn (rtos i1 2 0));将序号实数转换成字符
(setq sxy (strcat sn"," sy "," sx ))
(write-line sxy ff)
)
)
(setq i (+ i 1))
);repeat
)
(prompt "*只适合point点 << 命令:plzbsc >> *输出格式(点号,, Y,X)**")
(prin1)