在CAD中导入坐标和高程我们做测量的,用GPS测量出一组数据,是点名、坐标和高程,我想往CAD中导入,可以不要点名,就生成坐标和高程,想在图上显示是高程和坐标形成的点,求大虾给支支招
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 20:54:04
在CAD中导入坐标和高程我们做测量的,用GPS测量出一组数据,是点名、坐标和高程,我想往CAD中导入,可以不要点名,就生成坐标和高程,想在图上显示是高程和坐标形成的点,求大虾给支支招
在CAD中导入坐标和高程
我们做测量的,用GPS测量出一组数据,是点名、坐标和高程,我想往CAD中导入,可以不要点名,就生成坐标和高程,想在图上显示是高程和坐标形成的点,求大虾给支支招
在CAD中导入坐标和高程我们做测量的,用GPS测量出一组数据,是点名、坐标和高程,我想往CAD中导入,可以不要点名,就生成坐标和高程,想在图上显示是高程和坐标形成的点,求大虾给支支招
先将你的数据按每行为 点名,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 (