Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 23
Anonymous
1060 Views, 22 Replies

Findfile

Hi,

The lisp fonction "findfile" is use to find a file in the AutoCAD library search path or on a specific path.

So, if I want to find a file, for exemple, "winword.exe", whitout a specify path, is there a fonction for that ?

Thanks,

Marcel
22 REPLIES 22
Message 21 of 23
Anonymous
in reply to: Anonymous

> You're most welcome, lottsa good stuff at the mvps site 🙂

Yeah, I feel right at home. Writing Vlisp programs using VB code samples!

> (reasons-for-failure (dos_find "winword.exe"))
>
> ( "1: Ummm, is the app actually on this machine?"
> "2: Is the current drive not the same as app's drive?"
> "3: Is the current version of DosLib wonkey?"
> "4: Errr ..."
> )
>

2 is the reason. Who fires autocad in the winword executable path? I think
Frank and Luis' approaches are next best to the winapi route. Wish I had
time to work on it. It would be a nice diversion.

> 🙂
Message 22 of 23
Anonymous
in reply to: Anonymous

Well, here is something that I was able to recover (do not know if is a
latest version, since I just happen to lost about two years of
code...#%$)... Just remove the obvious lines... 🙂

(defun editor (file / arch key version apps dir f word wordpad)
(appload "SHORTFN14.ARX")
(vlisp-import-exsubrs '("SHORTFN14.ARX" "shortfn"))
(setq arch (shortfn file)
key "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\office"
version (vl-registry-descendents key))
(if version
(progn
(vl-some
'(lambda (vers)
(setq apps (vl-registry-descendents
(strcat key "\\" vers)))
(if (vl-some '(lambda (app) (= app "Word")) apps)
(progn
(setq dir (vl-registry-read
(strcat key
"\\"
vers
"\\Word\\InstallRoot")
"Path"))
(if dir
(if
(setq f
(findfile
(strcat
(substr dir 2 (- (strlen dir) 2))
"\\winword.exe")))
(progn
arch))
(setq wordpad T))))))
(if (and (not word) (not wordpad))
(command "._SHELL" (strcat "EDIT " arch))))))
Message 23 of 23
Anonymous
in reply to: Anonymous

It's a shame we have to do real work whilst so many pet projects despair of
their unrequited bit bashing. It's just not right 😞


"Cliff Middleton" wrote in message
news:812414DE15BE06500D10F7994019C735@in.WebX.maYIadrTaRb...
>
> > You're most welcome, lottsa good stuff at the mvps site 🙂
>
> Yeah, I feel right at home. Writing Vlisp programs using VB code samples!
>
> > (reasons-for-failure (dos_find "winword.exe"))
> >
> > ( "1: Ummm, is the app actually on this machine?"
> > "2: Is the current drive not the same as app's drive?"
> > "3: Is the current version of DosLib wonkey?"
> > "4: Errr ..."
> > )
> >
>
> 2 is the reason. Who fires autocad in the winword executable path? I
think
> Frank and Luis' approaches are next best to the winapi route. Wish I had
> time to work on it. It would be a nice diversion.
>
> > 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost