- UID
- 777769
- 积分
- 245
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2018-7-20
- 最后登录
- 1970-1-1
|
发表于 2019-2-2 11:50:27
|
显示全部楼层
把这段替换了,就可以画出点啦,后面图框还有毛病,自己调或者不要就行了
(defun c:zdxd()
;(zdt_gy)
(setq sblip (getvar "blipmode"))
(setq scmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(command "units" "2" "3" "2" "5" "270" "y")
(command "layer" "n" "sz" "c" "1" "sz" "")
(command "layer" "n" "sj" "c" "5" "sj" "")
(command "layer" "n" "控制点" "c" "4" "控制点" "")
(command "layer" "n" "地形点" "c" "3" "地形点" "")
(command "layer" "n" "中线点" "c" "3" "中线点" "")
(command "layer" "n" "高程" "c" "3" "高程" "")
(command "layer" "n" "图框" "c" "7" "图框" "")
(setq nam (getfiled "打开数据文件" "/acad/" "dat" 8))
(princ "\n正在绘图, 请稍侯 ......")
(setq d_f (open nam "r"))
(setq d_l (read-line d_f))
(setq d_l (read->biao d_l ","))
(setq d_ll d_l)
(setq x_max (nth 3 d_ll) y_max (nth 2 d_ll))
(setq x_min x_max y_min y_max)
(while (not (null d_ll))
(setq d_lx (car d_ll)
d_m (nth 1 d_ll)
d_x (nth 3 d_ll)
d_y (nth 2 d_ll)
d_h (last d_ll))
(setq d_x1 (- d_x 0.25)
d_x2 (+ d_x 0.25)
d_x3 (- d_x 0.75)
d_x4 (+ d_x 0.75)
d_x5 (+ d_x 1.25)
d_x6 (+ d_x 12.5))
(setq d_y1 (- d_y 0.25)
d_y2 (+ d_y 0.25)
d_y3 (- d_y 0.75)
d_y4 (+ d_y 0.75)
d_y5 (+ d_y 0.5)
d_y6 (- d_y 2.0))
(setq x_max (max x_max d_x))
(setq y_max (max y_max d_y))
(setq x_min (min x_min d_x))
(setq y_min (min y_min d_y))
(if (or (= d_lx "Z") (= d_lx "z")) (z_zd))
(if (or (= d_lx "K") (= d_lx "k")) (k_zd))
(if (or (= d_lx "D") (= d_lx "d")) (d_zd))
(setq d_l (read-line d_f))
(setq d_l (read->biao d_l ","))
(setq d_ll d_l)
);end while
补充的数据转化函数
(defun read->biao (str fgf / biao s1 i)
;(setq str "E004,35657.3676,14055.3419,126.4100" fgf ",")
(setq biao nil)
(setq i (vl-string-search fgf str))
(while i
(setq s1 (substr str 1 i))
(setq str (substr str (+ 2 i)))
(setq biao (append biao (list s1)))
(setq i (vl-string-search fgf str))
)
(setq biao (append biao (list str)))
(setq biao (list (nth 0 biao) (nth 1 biao) (atof (nth 2 biao)) (atof (nth 3 biao)) (atof
(nth 4 biao))))
);end fun
你这个数据文件,缺第1列,点的类型
z,E001,36210.9497,21029.0685,123.7000
k,E003,35845.7699,17007.5648,126.0200
d,E004,35657.3676,14055.3419,126.4100
z,E005,35023.1424,11605.2178,126.2600 |
评分
-
查看全部评分
|