cass或CAD里提取多段线节点的坐标的LSP程序谁有

 我来答
结婚协议
2016-10-05 · TA获得超过832个赞
知道小有建树答主
回答量:342
采纳率:50%
帮助的人:218万
展开全部
(defun c:gp()
(princ"函数功能:获取多义线点坐标. ")
(setvar "cmdecho" 0)
(setq ffn (getfiled "选取文件" "D:/zhb/" "dat" 1))
(setq ff (open ffn "w"))
(close ff)
(princ "\n选取PLINE多义线...")
(setq ss (ssget))
(setq i 0)
(setq ii 1) ;;输出点号
(setvar "pdmode" 33)
(repeat (sslength ss)
(setq ssn (ssname ss i))
(setq endata (entget ssn))
(setq n 0)
(repeat (length endata)
(setq pp (nth n endata))
(setq key (car pp))
(if (= key 10)
(progn
(setq x_temp (cadr pp))
(setq y_temp (caddr pp))
(setq x (rtos x_temp 2 3)) ;;把x后小数点变为四位输出
(setq y (rtos y_temp 2 3)) ;;把y后小数点变为四位输出
(setq iii (itoa ii))
(setq ff (open ffn "a"))
(princ iii ff)
(princ ",," ff)
(princ x ff)
(princ "," ff)
(princ y ff)
(princ "," ff)
(princ "0 "ff)
(princ "\n" ff)
(close ff)
(setq ii (1+ ii))
)
)
(setq n (1+ n))
)
(setq ii ii)
(setq i (1+ i))
)
(princ (strcat "\n文件写至=> " ffn))
(prin1)
)
(princ "\n====祝你工作顺利; 键入 gp 运行本插件")
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式