明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1532|回复: 2

open函数的路径问题

[复制链接]
发表于 2010-12-22 20:41:21 | 显示全部楼层 |阅读模式
(defun daochu()
(setq file2 (open "c:/1.TXT" "w"))
(write-line (itoa yzh1) file2)
(write-line (itoa yzh2) file2)
(write-line (itoa yzh3) file2)
(write-line (itoa yzh4) file2)
(close file2)
)


加入上面的代码保存为daochu.lsp,但此lsp放在哪里并不知道
我要让程序里的 c:/1.TXT,这个路径文件变成daochu.lsp的当前目录怎么设置?
发表于 2010-12-22 21:34:57 | 显示全部楼层
……
(if (setq path (findfile "daochu.lsp")) (progn
(setq fname (strcat  (substr path 1 (- (strlen path) 10)) "1.txt"))
……
))
……
 楼主| 发表于 2010-12-30 13:50:56 | 显示全部楼层
用第一行不就可以了么,第二行是干什么的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-10-2 18:26 , Processed in 0.156909 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表