根据南方CASS三角网土方-DTMTF.LOG文件注记填挖方量到图面
根据南方CASS三角网土方-DTMTF.LOG文件注记填挖方量到图面同时注记文字和属性快,利用XDCAD的 程序GU-XL 以及73哥程序修改而成,只是未能算出三角形面积(1 2 3)点构成的三角形标注上,很遗憾。路过高人如有兴趣改善此程序,定当感谢不尽。测试文件内容如下:
lifuq1979 发表于 2018-1-6 19:04
为什么不同时把三角形绘上
算量之前已经有三角网了 根据南方CASS三角网土方-DTMTF.LOG文件注记填挖方量到图面 结果能否整理成表格或者输出到excel 编号: 525211
1,61055.433,11666.052,7.984
2,61055.612,11665.999,7.963
3,61057.374,11667.853,8.104
挖方: 0.00 填方: 0.15
编号: 2
1,61055.053,11666.662,8.101
2,61055.433,11666.052,7.984
3,61057.374,11667.853,8.104
挖方: 0.00 填方: 0.67
编号: 3
1,61055.489,11665.870,7.953
2,61055.433,11666.052,7.984
3,61055.612,11665.999,7.963
挖方: 0.00 填方: 0.02
编号: 4
1,61051.316,11661.480,7.620
2,61052.069,11665.129,8.096
3,61055.053,11666.662,8.101
挖方: 0.00 填方: 5.47
编号: 5
1,61051.316,11661.480,7.620
2,61055.053,11666.662,8.101
3,61055.433,11666.052,7.984
挖方: 0.00 填方: 2.38
编号: 6
1,61051.316,11661.480,7.620
2,61055.433,11666.052,7.984
3,61054.542,11664.874,7.878
挖方: 0.00 填方: 0.44
编号: 7
1,61055.489,11665.870,7.953
2,61055.433,11666.052,7.984
3,61054.542,11664.874,7.878
挖方: 0.00 填方: 0.13 本帖最后由 树櫴希德 于 2014-5-27 13:39 编辑
测试文件后缀改为.LOG,删除最尾空行。 测试文件奉上,欢迎大家修改 下载 跟上 应该附上测试用的CAD图纸呵呵~ ((and (= l 3.0) (= gx 0.0))
(setq a (distance (nth 0 pt_lst) (nth 1 pt_lst)))
(setq b (distance (nth 1 pt_lst) (nth 2 pt_lst)))
(setq c (distance (nth 2 pt_lst) (nth 0 pt_lst)))
(setq s (* 0.5 (+ a b c)))
(setq lst-temp
(strcat "sqrt("
(rtos s 2 d1)
"*("
(rtos s 2 d1)
"-"
(rtos a 2 d1)
")"
"*("
(rtos s 2 d1)
"-"
(rtos b 2 d1)
")"
"*("
(rtos s 2 d1)
"-"
(rtos c 2 d1)
"))="
(rtos area 2 d2)
)
)
(setq lst (append lst (list lst-temp)))
(setq area_lst (append area_lst (list area)))
) ;三角形海伦公式 命令: PZX
请输入比例尺1:500
无效的复杂对象。
命令: 指定对角点: 支持下
1,61055.433,11666.052,7.984
2,61055.612,11665.999,7.963
3,61057.374,11667.853,8.104
是三角形的三个顶点? (mapcar '(lambda (x / p-p bh l-l )
(setq p(_Pnts:Center
(setq pa (str->pt (cadr x)))
(setq pb (str->pt (caddr x)))
(setq pc (str->pt (cadddr x)))
)
bh (substr (last x) 7)
ll (vl-remove "" (String:Split (car x) " "))
)
(_mktext (polar p _pi2 d) bh)
(_mktext p (strcat (car ll) (cadr ll)))
(_mktext (polar p _3pi d) (strcat (caddr ll) (last ll)))
(_mktext (polar p _3pi (* 2 d)) (strcat "面积:" (rtos (abs (getplarea (list pa pb pc))) 2 2)))
(gxl-cs:gcd p bh scale (strcat (car ll) (cadr ll)) (strcat (caddr ll) (last ll)))
)
nl
)
(defun getplarea (l)
(* 0.5
(apply
'+
(mapcar
'(lambda (a b) (- (* (car a) (cadr b)) (* (car b) (cadr a))))
l
(append (cdr l) (list (car l)))
)
)
)
)
页:
[1]
2