- 积分
- 11678
- 明经币
- 个
- 注册时间
- 2011-9-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 树櫴希德 于 2014-9-19 18:33 编辑
由于在有些地形图中,软件生成高程点时点位不像CASS那样是个INSERT,也不像SCS那样是个POINT,有些是HATCH 有些是圆弧 园 多段线等等,提取圆弧坐标已经被zzxxoo大神解决,提取图案填充中心坐标由SKG123大神程序+[q3_2006]q2大神代码合并而成,在此感谢2位大神!
(defun c:TQWZZB()
(princ "\n选择所需输出的点(point):")
(setq ss (ssget '((0 . "hatch")) ));;选取坐标点
(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))
;(setq pzx (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10))(entget (car (entsel))))))
(setq pzx (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10))(entget spt))))
(setq lxyz (list (nth 0 (cadr pzx)) (nth 1 (cadr pzx)) (nth 2 (car pzx)) ))
(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
(close ff)
)
(prompt "*只适合HATCH << 命令:TQWZZB >> *输出格式(点号,, Y,X,Z)**")
(prin1)
;(if (= (cdr (assoc 0 ept)) "TEXT")
; (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)
; )
; )
|
|