Jump to content

Recommended Posts

Posted

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

Posted
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:

Posted

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.

Posted

Thank you

 

i had a play with the findfile which works perfectly

 

Thanks again!!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...