cad如何导入坐标和高程
发布网友
发布时间:2022-04-21 00:30
我来回答
共5个回答
热心网友
时间:2022-06-16 18:24
先将你的数据按每行为 点名,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)
)
热心网友
时间:2022-06-16 18:25
我有CAD里批量导入点坐标和高程的软件
热心网友
时间:2022-06-16 18:25
你要给出一个数据的格式和导入后cad的图纸样式(或模板)文件,用来参考,才能给你答案
热心网友
时间:2022-06-16 18:26
不可以的,现在最新版的也不可以,我现在就用CAD
打字不易,如满意,望采纳。
热心网友
时间:2022-06-16 18:27
你说的应该是天正的软件把