明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2071|回复: 8

用lisp如何实现打开指定目录下的cad图

[复制链接]
发表于 2008-5-5 12:52:00 | 显示全部楼层 |阅读模式
用lisp如何实现打开指定目录下的cad图
 楼主| 发表于 2008-5-5 18:06:00 | 显示全部楼层

哪位老大知道啊?用lisp如何实现打开 关闭 保存 和不保存关闭cad图形!

发表于 2008-5-5 20:53:00 | 显示全部楼层
用lisp如何实现打开指定目录下的cad图

insert就可以了。


用lisp如何实现打开 关闭 保存 和不保存关闭cad图形!
需要配合doslib实现。
发表于 2008-5-6 07:09:00 | 显示全部楼层
明白了
 楼主| 发表于 2008-5-8 10:37:00 | 显示全部楼层
用哪个或哪几个doslib函数才能实现啊,我找了半天没有找到啊!请赐教!
发表于 2008-5-8 11:49:00 | 显示全部楼层

用什么doslib呀,用vlisp就可以了
试试我下面的程序,打开当前图纸同一目录下的其他图纸,可以按ctrl多选
把程序放到CAD的支持路径下 

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2008-5-10 20:33:00 | 显示全部楼层
;如何用LISP打开现有的abc.dwg图档
(defun OpenFile(FilePath Activate / oFile)
(vl-load-com)
(if(findfile FilePath)
(if(vl-file-systime FilePath)
(if
(vl-catch-all-error-p
(setq oFile
(vl-catch-all-apply
'vla-open
(list
(vla-get-Documents
(vlax-get-acad-object)) FilePath))))
(alert
(strcat "ERROR.\n Can't open file: " FilePath))
(if Activate(vla-Activate oFile))
); end if
(alert
(strcat "ERROR. File " FilePath
"\n may be opened, inaccessible or password protected."))
); end if
(alert
(strcat "ERROR.\n File not found: " FilePath))
); end if
oFile
); end of OpenFile
发表于 2011-11-15 23:03:10 | 显示全部楼层
如果我想用OPEN这个命令呢    指定文件的路径  
(command "open" d:/11.dwg "")  想知道为啥这样写不对
发表于 2013-5-27 08:30:57 | 显示全部楼层
OpenFile 怎么用的
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-29 05:45 , Processed in 0.191639 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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