- (defun c:TQZB()
- (princ "\n选择所需输出的点或文字:")
- ;(setq ss (ssget ));;选取坐标点
- (setq ss(ssget (list(cons 8 "GCD")(cons 2 "GC200"))))
- (setq n (sslength ss ));计算坐标点数量
- (setq ff (open (getfiled "文件保存为" "f:/" "dat" 1) "w"));保存路径
- (setq i 0)
- (repeat n
- (setq spt (ssname ss i ))
- (setq ept (entget spt))
- (if (= (cdr (assoc 0 ept)) )
- (progn
- (setq lxyz (cdr (assoc 10 ept)))
- (setq sx (rtos (nth 1 lxyz)));将坐标值实数转换成字符
- (setq sy (rtos (nth 0 lxyz)))
- (setq sz (rtos (nth 2 lxyz)))
- (setq i1 (+ i 1));计算点序号
- (setq sn (rtos i1 2 0));将序号实数转换成字符
- (setq sxyz (strcat sn",," sy "," sx "," sz))
- (write-line sxyz ff)
- )
- )
- (setq i (+ i 1))
- );repeat
- )
- (prompt "*提取地图中的高程点坐标值 << 命令:TQZB >> *输出格式(点号,, Y,X,Z)**")
- (prin1)
|