Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
hebboppp
Posts: 214
Registered: ‎06-10-2003
Message 1 of 23 (68 Views)

Findfile

68 Views, 22 Replies
09-23-2002 01:37 AM
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
Distinguished Contributor
BillZ
Posts: 4,707
Registered: ‎12-12-2003
Message 2 of 23 (68 Views)

Re: Findfile

09-23-2002 02:05 AM in reply to: hebboppp
With doslib, dos_find will find all instances of a file in the drive specified.

Free download at:
www.mcneel.com


Bill
*Middleton, Cliff
Message 3 of 23 (68 Views)

Re: Findfile

09-23-2002 02:34 AM in reply to: hebboppp
(acet-file-dir "winword.exe" "c:\\")
Requires acetutil.arx
--
Cliff

"hebboppp" wrote in message
news:f1111f7.-1@WebX.maYIadrTaRb...
> 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
>
>
*puckett, michael
Message 4 of 23 (68 Views)

Re:

09-23-2002 02:36 AM in reply to: hebboppp
(equal acet-functions 'pure-evil)

t

Subtitle: Use doslib functions or wrap the winapi function instead.

"Cliff Middleton" wrote in message
news:664B3EB85002C0B79D623DF75D1BF5AF@in.WebX.maYIadrTaRb...
> (acet-file-dir "winword.exe" "c:\\")
> Requires acetutil.arx
> --
> Cliff
>
> "hebboppp" wrote in message
> news:f1111f7.-1@WebX.maYIadrTaRb...
> > 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
*Middleton, Cliff
Message 5 of 23 (68 Views)

Re:

09-23-2002 02:59 AM in reply to: hebboppp
Agreed, but doslib has no equivalent (that requires no path or only parent).
Would you give a brief outline (or heck, just post the code) on how to use
the winapi function?

"michael puckett" wrote in message
news:3E200F5640E6AEEFD14360865BAC0322@in.WebX.maYIadrTaRb...
> (equal acet-functions 'pure-evil)
>
> t
>
> Subtitle: Use doslib functions or wrap the winapi function instead.
>
> "Cliff Middleton" wrote in message
> news:664B3EB85002C0B79D623DF75D1BF5AF@in.WebX.maYIadrTaRb...
> > (acet-file-dir "winword.exe" "c:\\")
> > Requires acetutil.arx
> > --
> > Cliff
> >
> > "hebboppp" wrote in message
> > news:f1111f7.-1@WebX.maYIadrTaRb...
> > > 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
>
>
*puckett, michael
Message 6 of 23 (68 Views)

Re:

09-23-2002 03:04 AM in reply to: hebboppp
Just pen a recursive wrapper around either. I post it but it's not currently
at my disposal. Surely another poster has an up to date version.

An old, one-off version (never revisited) exists at

http://www.cadvision.com/puckettm/autolisp/filefind/index.htm

It is slow on large trees (e.g. starting at root directory, but it will
slog thru and file all instances in a given tree (iirc). I believe Eric
penned an improved version based on this one.

PS: said site is dead (not even my isp anymore), so I don't know how long
this url will be good for.

Cheers.

Oh! Sandwich time. *Poof*

"Cliff Middleton" wrote in message
news:735099B58B4F0726B20725EB520E517A@in.WebX.maYIadrTaRb...
> Agreed, but doslib has no equivalent (that requires no path or only
parent).
> Would you give a brief outline (or heck, just post the code) on how to use
> the winapi function?
*Esquivel, Luis
Message 7 of 23 (68 Views)

Re: Findfile

09-23-2002 03:05 AM in reply to: hebboppp
Well since I do not have winword (long story, I just lost about two years of
hard work)

You should be able to look under:

(setq key "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\office")

(setq version (vl-registry-descendents
"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\office"))

(setq apps (vl-registry-descendents
(strcat key "\\" vers)))

(setq dir
(vl-registry-read
(strcat key "\\" vers "\\Word\\InstallRoot")
"Path"))

(setq
f (findfile
(strcat
(substr dir 2 (- (strlen dir) 2))
"\\winword.exe")))


Luis E.

Sorry, I will try to put the above inside a function, but will be until
tomorrow.
*Broad, Doug
Message 8 of 23 (68 Views)

Re:

09-23-2002 03:19 AM in reply to: hebboppp
First:
Michael,
> > (equal acet-functions 'pure-evil)
> > t

I enjoyed your humor!

Cliff,
>Agreed, but doslib has no equivalent (that requires no path or only parent).
>Would you give a brief outline (or heck, just post the code) on how to use
>the winapi function?

Wouldn't this work?

(dos_find "winword.exe")

It does on my machine. (Doslib 5.something)

(startapp (car(dos_find "winword.exe")))

Regards,
Doug
*Middleton, Cliff
Message 9 of 23 (68 Views)

Re:

09-23-2002 04:15 AM in reply to: hebboppp
I'm using doslib 6.0. Returns nil.
--
Cliff

"Doug Broad" wrote in message
news:848CEAE609F11F72128B53DA1CE17D7B@in.WebX.maYIadrTaRb...
> Wouldn't this work?
>
> (dos_find "winword.exe")
>
> It does on my machine. (Doslib 5.something)
>
> (startapp (car(dos_find "winword.exe")))
>
> Regards,
> Doug
>
>
*Middleton, Cliff
Message 10 of 23 (68 Views)

Re:

09-23-2002 04:22 AM in reply to: hebboppp
I have a recursor that uses vl-directory-files (is that what you meant by
the winapi function?) but it's a real tortise compared to the despised
acet-file-dir function.
--
Cliff

"michael puckett" wrote in message
news:B533B579FD85CB08F69D5D83AA0CDC1C@in.WebX.maYIadrTaRb...
> Just pen a recursive wrapper around either. I post it but it's not
currently
> at my disposal. Surely another poster has an up to date version.
>
> An old, one-off version (never revisited) exists at
>
> http://www.cadvision.com/puckettm/autolisp/filefind/index.htm
>
> It is slow on large trees (e.g. starting at root directory, but it will
> slog thru and file all instances in a given tree (iirc). I believe Eric
> penned an improved version based on this one.
>
> PS: said site is dead (not even my isp anymore), so I don't know how long
> this url will be good for.
>
> Cheers.
>
> Oh! Sandwich time. *Poof*
>
> "Cliff Middleton" wrote in message
> news:735099B58B4F0726B20725EB520E517A@in.WebX.maYIadrTaRb...
> > Agreed, but doslib has no equivalent (that requires no path or only
> parent).
> > Would you give a brief outline (or heck, just post the code) on how to
use
> > the winapi function?
>
>
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.