嗨,迈克尔
这可用于确定是否存在驱动器。我不知道更改DWGPREFIX系统变量是否会更改驱动器。如果问题解决了,开始在每个驱动器中使用findfile。
如果这不起作用,我想你必须写一个递归函数来手动读取每个驱动器中的每个目录。例如
- ;Disclaimer
- ; I've wrote this in the quick reply box and have no idea if it works and to be honest I'm not entirely sure
- ; that the way it pases results out of it will work but hey it's only an example.
- (someFunction baseDirectory findMe( / result)
- ;Get directory contents
- (setq contents (vl-directory-files baseDirectory)
- ;With each of the driectory contents
- (foreach c contents
- ;Determine if item is a file or folder
- (if(not(vl-filename-extension baseDirectory))
- ;It's a directory!
- (setq result(apply 'append(list (someFunction path findMe))))
- ;It's a file!
- (if(equal c findMe)
- (setq result c)
- )
- )
- result
- )
我确信上述方法并不是最好的方法,但如果你不能让finfile在所有驱动器中都工作,我会不顾一切地选择与上述方法类似的方法
如果一个目录包含的不仅仅是共享搜索名称的文件,并且您希望获取该文件的最新版本,那么您希望得到什么结果?
索利弗 |