QUIT event

QUIT event

Anonymous
Not applicable
165 Views
5 Replies
Message 1 of 6

QUIT event

Anonymous
Not applicable
The AutoCAD R2000 application object has a BeginQuit event but not an
EndQuit.

If you use the BeginQuit event to trigger a quitting sequence then the next
thing that happens is that the document object asks whether the user wants
to save the file or not. If the user says Cancel then the BeginQuit event
will have been in vain.

It is no good checking how many documents are open because AutoCAD can be
running
without any drawing being open!

A solution would be to have a timer check whether AutoCAD is running, but
this doesn't seem very elegant given the fact that AutoCAD does trigger
events.

So the question is how to trigger an event when AutoCAD has actually shut
down.
0 Likes
166 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Welcome to my world. I have exactly the same problem with documents. The
Activate event is only useful if you have object reference for every open
drawing in the current session. And the Deactivate event doesn't report
which document is about to become active.

As for the EndQuit, that's a catch 22. AutoCAD can't fire an event since it
is no longer running. Looks like we need a superset of the AutoCAD event
model. maybe one the local arx gurus will be able to help.

Stuart Nathan wrote in message
news:7vn4tp$oa69@adesknews2.autodesk.com...
> The AutoCAD R2000 application object has a BeginQuit event but not an
> EndQuit.
>
> If you use the BeginQuit event to trigger a quitting sequence then the
next
> thing that happens is that the document object asks whether the user wants
> to save the file or not. If the user says Cancel then the BeginQuit event
> will have been in vain.
>
> It is no good checking how many documents are open because AutoCAD can be
> running
> without any drawing being open!
>
> A solution would be to have a timer check whether AutoCAD is running, but
> this doesn't seem very elegant given the fact that AutoCAD does trigger
> events.
>
> So the question is how to trigger an event when AutoCAD has actually shut
> down.
>
>
>
>
0 Likes
Message 3 of 6

Anonymous
Not applicable
tell me more about activate
0 Likes
Message 4 of 6

Anonymous
Not applicable
That's an easy one. Assuming you have a reference to the correct document
object, the Activate event occurs when the drawing becomes the current
document. But it requires a little work to implement properly.

Let's assume there are two drawings currently open in AutoCAD. You use the
following code:

Dim WithEvents A as AcadDocument
Set A = acadApp.ActiveDocument

Now you can react to events for the current document. Then the user switches
to document B. Document A fires the Deactivate event and lies dormant until
it is reactivated. Apparently the only way around this problem (short of
using a timer) is to mirror AutoCAD's document collection. But if I add
document objects to a collection, how do I receive events from specific
documents?

Stuart Nathan wrote in message
news:7vpb9o$sc211@adesknews2.autodesk.com...
> tell me more about activate
>
>
0 Likes
Message 5 of 6

Anonymous
Not applicable
I can give you the answer, but it took me a little effort to get there, so
could you give me your private email (I tried but it got spammed) and could
you let me know what your application is about
0 Likes
Message 6 of 6

Anonymous
Not applicable
Hi,
I know yours was an old post, but I am new to watching the users groups

Stuart Nathan wrote:

> The AutoCAD R2000 application object has a BeginQuit event but not an
> EndQuit.
>
> If you use the BeginQuit event to trigger a quitting sequence then the
> next
> thing that happens is that the document object asks whether the user
> wants
> to save the file or not. If the user says Cancel then the BeginQuit
> event
> will have been in vain.
>

Using the asdkunsupp2000.arx, there is a method called setdbmod.
This allows you to reset the acad dbmod system variable to 0, so that
the save dialog does not come up.
Of course, you will have to be handling document saves in a way that
makes this dialog unnecessary.

elly

--

Elly Bachrach
Heide Corporation
7434 Skokie Blvd.
Skokie, IL 60077
Phone: (847) 676-2880
Fax: (847) 982-2304
E-Mail: ebachrach@heidecorp.com
--
Headquarters
5 West Mill Street
Medfield MA 02052
Phone: 508 359 5885
Fax: 508 359 2737
http://www.heidecorp.com
0 Likes