Author Topic: reactor on QUIT.  (Read 7733 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
reactor on QUIT.
« on: October 16, 2006, 10:17:06 AM »
Good morning All.. 8-)

I'm playing with reactor..
and trying do to something like this..

Code: [Select]
(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. :-)
« Last Edit: October 16, 2006, 10:19:15 AM by Andrea »
Keep smile...

Patrick_35

  • Guest
Re: reactor on QUIT.
« Reply #1 on: October 16, 2006, 10:39:37 AM »
Hi

Code: [Select]
(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"))
)

@+
« Last Edit: October 16, 2006, 10:41:26 AM by Patrick_35 »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: reactor on QUIT.
« Reply #2 on: October 16, 2006, 10:47:05 AM »
Code: [Select]
(vlr-command-reactor nil
   '( 
        (:vlr-commandWillStart . _CommandWillStart)
    )
)

(defun _CommandWillStart ( reactor args  )
    (if (member (car args) '("QUIT" "END"))
        (alert "I'm about to die!")
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: reactor on QUIT.
« Reply #3 on: October 16, 2006, 01:22:31 PM »
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:
« Last Edit: October 16, 2006, 01:30:24 PM by Andrea »
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: reactor on QUIT.
« Reply #4 on: October 16, 2006, 01:42:15 PM »
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!")
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: reactor on QUIT.
« Reply #5 on: October 16, 2006, 02:37:53 PM »
vlr-documentToBeDestroyed !!

thats the way !

thanks MP.
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: reactor on QUIT.
« Reply #6 on: October 16, 2006, 03:16:51 PM »
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 ?
« Last Edit: October 16, 2006, 03:18:15 PM by Andrea »
Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: reactor on QUIT.
« Reply #7 on: October 16, 2006, 03:24:11 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: reactor on QUIT.
« Reply #8 on: October 16, 2006, 04:13:19 PM »
ok ...thank you. :kewl:
Keep smile...