在CAD中导入坐标和高程
发布网友
发布时间:2022-04-21 00:30
我来回答
共2个回答
热心网友
时间:2022-06-16 18:24
简单点的话就下一个南方cass7.0(和天正一样是一种辅助cad软件)软件,网上有破解版,根据你cad版本选用破解文件,装好后点标题栏上的“绘图处理”选项里的“展高程点”出现一个对话框,选择你gps存在电脑里的坐标文件就可以在cad里看见了。 坐标文件要是dat格式的。
热心网友
时间:2022-06-16 18:25
先将你的数据按每行为 点名,x,y,z 的格式用记事本存为point.csv放在D:\下。如果是excel档且为四列数据那可直接另存为CSV档。
然后将一下代码用记事本存为poi.lsp 后加载运行即可。
(defun c:poi()
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
(command "STYLE" "ZDBH" "" "" 0.65 0.0 "" "" "")
;;;;;;;;;
(setq txtdate '((0 . "TEXT") (5 . "46D1") (100 . "AcDbEntity")
(67 . 0) (8 . "TEXT-J") (100 . "AcDbText") (10 9330.57 45057.9 2.90846e-017)
(40 . 300.0) (1 . "1C1B(01)") (50 . 0.0) (41 . 0.7) (51 . 0.0) (7 . "ZDBH")
(71 . 0) (72 . 0) (11 10036.3 44957.9 2.90846e-017) (210 0.0 0.0 1.0) (100 .
"AcDbText") (73 . 0)))
;;;;;;;;
(setq lid (open "d:\\point.csv" "r"))
(while (setq pn (read-line lid))
(setq lind pn)
(setq at (pofs lind ","))
(setq z1 (atof (substr lind (+ 1 at))))
(setq lind (substr lind 1 (- at 1)))
(setq at (pofs lind ","))
(setq y1 (atof (substr lind (+ 1 at))))
(setq lind (substr lind 1 (- at 1)))
(setq at (pofs lind ","))
(setq x1 (atof (substr lind (+ 1 at))))
(setq pd (list x1 y1 z1))
(command "point" pd)
(setq TXTdate (subst (cons 1 pn) (assoc '1 TXTDate) TXTdate))
(setq TXTdate (subst (cons 10 pd) (assoc '10 TXTdate) TXTdate))
(setq TXTdate (subst (cons 11 (list 0 0 z1)) (assoc '11 TXTdate) TXTdate))
(entMAKE txtdate)
)
( close lid)
(setvar "osmode" osm)
)
(DEFUN PofS(Soutxt subtxt / kk TLEN TPTXT tnb as)
(SETQ TLEN (STRLEN Soutxt))
(SETQ kk 1)
(SETQ as nil)
(SETQ stn (ascii subtxt))
(WHILE (<= kk TLEN)
(SETQ TPTXT (SUBSTR Soutxt kk 1))
(SETQ tnb (ascii TPTXT))
(if (= stn tnb) (setq as kk))
(SETQ kk (+ 1 kk))
)
(setq as as)
)