明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 910|回复: 4

[函数] 读取纬地原始地貌数据转换成点表

[复制链接]
发表于 2018-10-25 23:11 | 显示全部楼层 |阅读模式
;;[功能]读取纬地原始地貌数据转换成点表
;;[用法](LC:Make-LWPOLYLINE (LC:read-Weft-pts lst (setq pt (getpoint)) (setq hxbl 1000.0) (setq zxbl 1000.0)))
;;[作者]BY 老仓测绘上班记
;;;(setq txt (try-read-txt WeftFILEpath))
;;;  (if (= (car txt) "HINTCAD5.83_HDM_SHUJU")
;;;    (setq txt (gxl-removeNth3 0 txt))
;;;  )
;;;  (setq txt (LC:devidelist txt 3))
;;;  (setq dmlen (length txt));断面数量
(defun LC:read-Weft-pts (LST PT HXBL ZXBL / LC LSTLEFT LSTRIGHT PTLST I PTS PJGC P)
  (setq lc (atof(car lst)))
;;;  (setq lstleft (LC:devidelist (gxl-removeNth3 0 (LC:NUMStr2List (cadr lst))) 2));左
;;;  (setq lstright (LC:devidelist (gxl-removeNth3 0 (LC:NUMStr2List (caddr lst))) 2));右
  (setq lstleft (LC:WEFT-left1 (gxl-removeNth3 0 (LC:NUMStr2List (cadr lst)))));左偏距高差表
  (setq lstright (LC:WEFT-right1 (gxl-removeNth3 0 (LC:NUMStr2List (caddr lst)))));右偏距高差表
  (setq ptlst '()
ptlst (append ptlst lstleft lstright));总偏距高差表
  (setq i 0 pts '())
  (repeat (length ptlst)
    (setq pjgc (nth i ptlst))
    (setq p (LC:Pt2XY pt (* (car pjgc) (/ 1000.0 hxbl)) (* (cadr pjgc) (/ 1000.0 zxbl))))
    (setq pts (append pts (list p)))
    (setq i(1+ i))
  )
  pts
)

;;[功能]相对前点转化成相对中点左侧数据
;;[用法]
;;[作者]BY 老仓测绘上班记
(defun LC:WEFT-left1(lst / l)
  (while lst
    (setq l(cons(mapcar'+(list(car lst)(cadr lst))(if l(car l)'(0 0)))l)
lst(cddr lst)))
  (mapcar '(lambda(x)(list(-(car x))(cadr x)))l)
  )
;;[功能]相对前点转化成相对中点右侧数据
;;[用法]
;;[作者]BY 老仓测绘上班记
(defun LC:WEFT-right1 (LST / L)
  (while lst
    (setq l(cons(mapcar'+(list(car lst)(cadr lst))(if l(car l)'(0 0)))l)
lst(cddr lst)))
  (reverse l)
)

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2018-11-12 14:01 | 显示全部楼层
同是断面人。非常感谢你分享的这个源码。我就觉得编写麻烦就没有写
发表于 2020-10-31 13:08 | 显示全部楼层
常感谢 分享的这个源码
发表于 2020-11-7 07:58 来自手机 | 显示全部楼层
感谢 分享的这个源码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-26 09:17 , Processed in 2.626878 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表