; 提取数字高程[mini_gc_tqsz].lsp
(defun c:mini_gc_tqsz ( / old_cmd ss sn i ff ww )
	(mini_start nil)
	(mai_last_com "mini_gc_tqsz")

	(mai_get_scale)
	(setq
		ww (/ mai_scale 1000)
		ww (list (* ww -1.5) ww)
		ss (mai_select_first
				'((0 . "TEXT") (1 . "~*[~`--9]*"))
				"选择要择要提取高程的数字:<回车退出>"
				"没有找到任何数字."
			)
		i 0
		ss (mapcar
				'(lambda ( si / x pt )
					(setq
						pt (mai_dxf 10 (entget si))
						i (1+ i)
						x (mapcar '(lambda(y) (rtos y 2 3)) (mapcar '+ ww pt))
					)
					(strcat (itoa i) " , GCD , " (cadr x) " , " (car x) " , " (mai_get_textstring si)))
				)
				(mai_ssget_2_list ss)
			)
		ff (mai_GetorNewFile "选择dat文件文件" mai_mini_path "dat" nil)
	)
	(or ff (exit))
	(mai_write_file ff sn)
	(princ (strcat "\n文件保存位置: " ff))
	(princ (strcat "\n本次总共提取了 < " (itoa i) " > 个高程点"))
	(mai_end)
)
