TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on October 16, 2006, 10:17:06 AM
-
Good morning All.. 8-)
I'm playing with reactor..
and trying do to something like this..
(vl-load-com)
(vlr-command-reactor nil '((:vlr-commandEnded . endQCommand)))
(defun endQCommand (calling-reactor endquitInfo / EQP)
(setq EQP (nth 0 endquitdInfo))
(if (= EQP "QUIT") (alert "QUIT ended"))
)
But AutoCAD QUIT before showing the alert box...
same thing with commandCancelled and failed.
What i'm trying to do is to put some cad user information on a network drive before leaving AutoCAD.
Any help will be appreciated.
thanks. :-)
-
Hi
(vl-load-com)
(vlr-command-reactor nil (list (cons :vlr-CommandWillStart (function endQCommand))))
(defun endQCommand (calling-reactor endquitInfo)
(if (= (car endquitInfo) "QUIT") (alert "QUIT ended"))
)
@+
-
(vlr-command-reactor nil
'(
(:vlr-commandWillStart . _CommandWillStart)
)
)
(defun _CommandWillStart ( reactor args )
(if (member (car args) '("QUIT" "END"))
(alert "I'm about to die!")
)
)
-
woo ! :roll:
thanks guys...but not working ! :-)
I think that's using vlr-commandWillStart is not the solution...
because autocad do not detect if user press Cancel in the dialog box when drawing wasn't save
by the way...MP....Nice avatar ! :wink:
-
My guess is you're not talking about the AutoCAD application being killed, you're talking about a document being closed. Perhaps --
(vlr-docmanager-reactor nil
'(
(:vlr-documentToBeDestroyed . _DocumentToBeDestroyed)
)
)
(defun _DocumentToBeDestroyed ( reactor args )
(alert "Document about to die!")
)
-
vlr-documentToBeDestroyed !!
thats the way !
thanks MP.
-
oops...!!
was enjoying to earlier..
The routine work well only if we close a drawing....
but not when closing AutoCAD without any drawing...
so that create another question..
Is it possible to run any lisp without any drawing open ?
The program i'm trying to create is to send a message only when AutoCAD is closing.
is this possible in lisp ?
-
so that create another question..
Is it possible to run any lisp without any drawing open ?
The program i'm trying to create is to send a message only when AutoCAD is closing.
is this possible in lisp ?
Not that I know of. You may have to look at another language.
-
ok ...thank you. :kewl: