FazBear Posted May 29, 2009 Posted May 29, 2009 Hi All I have a lisp the relies on a pmp file being accessable from the printer configuration file paths. if a users printer configuration file paths are incorrect the lisp crashes. Is their a way to run an alert then exit if pmp file cannot be located? i was thinking something like: (if (pmp file cannot be located) (progn (alert "\nthe correct pmp file cannot be located please check your printer configuration file paths and try again")) (exit) );end progn ); end if Any advise would be appreciated. Cheers Quote
Lee Mac Posted May 29, 2009 Posted May 29, 2009 Hi All I have a lisp the relies on a pmp file being accessable from the printer configuration file paths. if a users printer configuration file paths are incorrect the lisp crashes. Is their a way to run an alert then exit if pmp file cannot be located? i was thinking something like: (if (pmp file cannot be located) (progn (alert "\nthe correct pmp file cannot be located please check your printer configuration file paths and try again")) (exit) );end progn ); end if Any advise would be appreciated. Cheers If its in the ACAD Search Path, you could use "findfile" to try to locate it :wink: Quote
David Bethel Posted May 29, 2009 Posted May 29, 2009 McNeels DOSLIb is a ton better than ACAD for this type of testing. And it's free. -David http://www.en.na.mcneel.com/doslib.htm Quote
CALCAD Posted May 30, 2009 Posted May 30, 2009 FazBear, you could try as Lee suggested : (defun c:fpmp (/) (if (not (findfile "c:\\file.pmp")) (alert "\n the correct pmp file cannot be located please check your printer configuration file paths and try again") ) (princ) ) or if you have Doslib as David suggested, this should work : (defun c:fpmp (/) (if (not (dos_find "file.pmp")) (alert "\n the correct pmp file cannot be located please check your printer configuration file paths and try again") ) (princ) ) This program is so simple, you don't need an EXIT. The Doslib library contains a lot of functions for directory and file operations and other stuff. It might be worth looking at, if you haven't already. See it at www.mcneel.com Oh yeah, David already provided the link. Quote
FazBear Posted May 30, 2009 Author Posted May 30, 2009 Thank you i had a play with the findfile which works perfectly Thanks again!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.