cad导入cass格式坐标生成三维多段线lsp程序

希望实现cad导入cass格式坐标生成三维多段线,并且显示点号文件格式如下:1,,0.000,0.000,0.0002,,0.000,10.000,10.0003,,0.... 希望实现cad导入cass格式坐标生成三维多段线,并且显示点号
文件格式如下:
1,,0.000,0.000,0.000
2,,0.000,10.000,10.000
3,,0.000,20.000,0.000

修改下面的程序实现这个功能也行,谢谢【提示:下面程序可用格式格式为X,Y,Z,】
(defun c:ddr()
(setvar "cmdecho" 1)
(setvar "osmode" 0)
(setvar "modemacro" " YuCheng ")
(setq zb_file (getfiled "选择点坐标文件" "" "txt" 0))
(setq x (open zb_file "r"))
(prompt"\n.\n.\nwait...")
(princ)
(while (setq pt (read-line x))
(command "_.3DPOLY" pt)
(while (and (/= (setq pt (read-line x)) "END") (/= pt "end") (/= pt nil) (/= pt ""))
(command pt)

)
(command "c")
(command)
(command)
(setq ent (entlast))
(redraw ent 3)
)
(close x)
(setvar "cecolor" oldcolor)
(princ)
)
3,,0.000,20.000,0.000
修改下面的程序实现这个功能也行,谢谢【提示:下面程序可用格式格式为X,Y,Z,】
(defun c:ddr()
(setvar "cmdecho" 1)
(setvar "osmode" 0)
(setvar "modemacro" " YuCheng ")
(setq zb_file (getfiled "选择点坐标文件" "" "txt" 0))
(setq x (open zb_file "r"))
(prompt"\n.\n.\nwait...")
(princ)
(while (setq pt (read-line x))
(command "_.3DPOLY" pt)
(while (and (/= (setq pt (read-line x)) "END") (/= pt "end") (/= pt nil) (/= pt ""))
(command pt)

)
(command "c")
(command)
(command)
(setq ent (entlast))
(redraw ent 3)
)
(close x)
(setvar "cecolor" oldcolor)
(princ)
)
展开
 我来答
bcatv
2015-08-02 · TA获得超过4434个赞
知道大有可为答主
回答量:4763
采纳率:77%
帮助的人:567万
展开全部
LISp字符处理,把逗号间隔的数字提取出来,得到X,Y ,Z
然后在画多段线时把得到的XYZ值输进去
主要修改这一行(while (and (/= (setq pt (read-line x)) "END") (/= pt "end") (/= pt nil) (/= pt ""))

可能需要多写几行:先编一个取某2个逗号间字符的函数吧
嗯,有点小麻烦,等有空吧
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式