首页 » 测量源码 » AutoLisp |
绘制纵断面地面线的程序[转] |
时间:2017-04-06 17:24:38,点击:0 |
;jyzdm.lsp ;说明----1.使用本程序前,请先建立名为“HZ”的字型; ; 2.使用本程序前,请先确定原点位置。 ; 3.本程序所用命令名为JYZDM。 ; 编写人:段悟哲 1999-5-30 (defun c:jyzdm() ;赋全局变量默认值 (if (= #ql nil) (setq #ql 0.0)) (if (= #qg nil) (setq #qg 0.0)) (if (= #zg nil) (setq #zg 3.0)) (if (= #hb nil) (setq #hb 5000.0)) (if (= #vb nil) (setq #vb 500.0)) (if (= #gp nil) (setq #gp 1.0)) (if (= #x nil) (setq #x 0.0)) (if (= #y nil) (setq #y 0.0)) (initget "Yes No") (setq YorN(getkword "重新定义基础数据?(Yes or No)<Yes>:")) (if (= YorN nil) (progn ;---输入本图基础数据 (setq #ql(getreal "\n本图起始里程:") #qg(getreal "\n本图起始高程:") #zg(getreal "\n字体高度:") #hb(getreal "\n纵断面横向比例:") #vb(getreal "\n纵断面纵向比例:") #x(getreal "\n地面线起始点里程:") #y(getreal "\n地面线起始点高程:") #lc(getreal "\n里程书写位置:") #gc(getreal "\n地面高程书写位置:") #x(/ (- #x #ql) (/ #hb 1000)) #y(/ (- #y #qg) (/ #vb 1000)) );setq (setq px0 #x) );progn );if ;---由地面线起始点里程计算公里标所在位置 ;---输入中桩里程及其对应的地面高程并按比例计算地面点所在位置 (setq fi(getfiled "选择地面高程数据文件" "\\r13" "txt"4)) (setq fp (open fi "r")) (while(setq po(read-line fp)) (setq po(read po)) (setq #zl(car po) #dg(car (cdr po))) (cond ((/= #zl nil) (setq zls(- #zl (* (fix (/ #zl 100)) 100)) px(/ (- #zl #ql) (/ #hb 1000)) py(/ (- #dg #qg) (/ #vb 1000)) );setq ;---写出中桩里程(不含百米及以上数字) (if (> (- px px0) (* #zg 1.5)) (progn (cond ((/= zls 0.0) (command "line" (list px (+ 5 #lc)) (list px (- #lc 5)) nil) (command "text" "s" "hz" "mc" (list (- px #zg) #lc) #zg "90" (rtos zls 2 2) nil)) );cond (command "line" (list px (+ #gc 5)) (list px (- #gc 5)) nil) (command "text" "s" "hz" "mc" (list (- px (+ (/ #zg 2) 1)) #gc) #zg "90" (rtos #dg 2 2) nil);command (setq px0 px))) ;---连接地面线 (command "line" (list #x #y) (list px py) nil) ;---替换地面高程点所用全局变量值 (setq #x px) (setq #y py) ))) (close fp) );defun (print "已成功装载,输入“JYZDM”开始!") ;---结束 |
【打印】【关闭】 |
本站的部分源程序是由站长由网络收集整理的,如有侵权,请告之,我会第一时间删除相关内容。 因时间原因,源码不可能每一个都进行了测试,所以不能保证源码全是正确的,提供源码只是提供一份思路,一个参考,方便写出专属于您自己的程序 |
Copyright 2003-2025 测量天地
(SurveySky.Com)
All Rights Reserved.
备案许可证:新ICP备12001392号-1 | 关于我们 | 联系我们 |网站留言| |