• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

error management

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I would like to manage a specific error so that the lisp program behaves as I wish.
I did some evidence but I didn't find the solution.
If I call a lisp command without charging it, obviously there is an error reported as "unknown command".
faced with the occurrence of the error, I would like there to be a reaction like displaying a "alert" or launching an external program with "runapp" or "startapp" commands.
Thank you.
 
no need to intercept the error, just prevent it:
(if (null c:tuocommando) (alert "....."))
in place of alert you can also insert (load"tuaroutine")
 
thanks rpor66,
I can't understand code usage.
should I put it in > acad.lsp < but how do I activate it?
Thank you.
 
I solved the problem like this:
Code:
 (defun c:mycomando (/)

(setq commandx "preparapunti")

(if (/=controlgpscad 1); "c:\\\\autocadsupport\\\\lisptre\\\gpscad.lsp"
(progn)
(alert "you must first load the gpscad")
(vl-exit-with-error "exit from the program")
);
(eval (read commandx)
);

);
where > controlgpscad < is an active variable loading "c:\\\autocadsupport\\\\lisptre\\\gpscad.lsp"
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top