明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 22591|回复: 57

vlisp如何打开多重选择文件对话框

  [复制链接]
发表于 2005-9-25 09:56:00 | 显示全部楼层 |阅读模式
lisp中有getfiled函数打开选择文件,可是不能多重选择,又没有别的办法,可以进行多重选择?
发表于 2005-9-25 10:36:00 | 显示全部楼层
(dos_getfilem) in DosLib
发表于 2005-9-25 11:26:00 | 显示全部楼层
http://www.xdcad.net/forum/showthread.php?s=&threadid=462509
 楼主| 发表于 2005-9-25 14:59:00 | 显示全部楼层

alin版主:可以不用doslib吗?因为这个跟版本有关系的,我个人不是很喜欢。

ea:你那个链接打不开。我在xdcad上搜索了一下,也没有发现有价值的。

其实,这个功能我可以通过vb ActiveX DLL来实现,但是我就是想知道不通过这个,在vlisp下的直接调用系统资源能否实现?

发表于 2005-9-25 16:38:00 | 显示全部楼层

这是最简洁的办法。DosLib又不是只有这个函数有用。

发表于 2005-9-25 17:38:00 | 显示全部楼层
本帖最后由 作者 于 2005-9-25 18:21:26 编辑
  1. http://www.xdcad.net/forum/forumdisplay.php?s=&forumid=50
  2. ;;test OK with XP
  3. (defun xd-getfiles (/ x erg)
  4.   (if (setq x (vlax-create-object "MSComDlg.CommonDialog"))
  5.     (progn (vlax-put-property x "DialogTitle" "选择图形文件")
  6. 	   (vlax-put-property x "Filename" "*.dwg")
  7. 	   (vlax-put-property x "Filter" "*.dwg")
  8. 	   (vlax-put-property x "MaxFileSize" 10000)
  9. 	   ;; in lisp unbedingt notwendig, sonst kommt ne
  10.            ;;fehlermeldung von wegen zu wenig speicher
  11. 	   (vlax-put-property x "Flags" 512)
  12. 	   (vlax-put-property x "Action" 1) ;_ showopen-dialog  
  13. 	   (setq erg (vlax-get-property x "Filename"))
  14.     )
  15.   )
  16.   (if (/= erg "*.dwg")
  17.     erg
  18.     nil
  19.   )
  20. )
 楼主| 发表于 2005-9-25 19:30:00 | 显示全部楼层
Ea发表于2005-9-25 17:38:00

谢谢ea:可以实现,但是这个窗口很难看,不是vb中的那个多选框那么漂亮。ea:这个程序一模一样相同功能还可以通过脚本来实现。
发表于 2005-9-25 20:09:00 | 显示全部楼层
很遗憾漂亮的对话框不能多选,解决方案寻找中。
发表于 2005-9-29 22:21:00 | 显示全部楼层
6楼 ,我在winxps2 + CAD2006 下运行,返回nil。

怎么回事啊?

发表于 2005-9-29 23:23:00 | 显示全部楼层

改变 "flags"参数的值,可以得到不同的对话框

(vlax-put-property x "Flags" 512)

具体的数值可以查相关的帮助。

 

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-7-20 12:50 , Processed in 0.167593 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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