Still looking for a shutting down reactor....

Still looking for a shutting down reactor....

Anonymous
Not applicable
541 Views
12 Replies
Message 1 of 13

Still looking for a shutting down reactor....

Anonymous
Not applicable
Hi Gang,
I'm hoping somebody has found one now.....

I've got document reactors running that sense a jump between drawings.
(MDI). What I'm looking for is a way to STOP those reactors when a user
does something that causes the system to exit AutoCAD. A good one is when
the user hits the "X" to close down AutoCAD.

(My document reactors tell the user when they switch to a "RAW" drawing
versus a drawing that has been configured with project number and such. We
want to alert the user to this fact. Right now, you shut down Acad. The
system will continue to display the warnings until all documents have been
shut down.)

Anybody have any ideas?

Thanks,
Nick
Env: A2K/VC6/W2K
0 Likes
542 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
How about this? In the CommandWillStart reactor, if the command us "QUIT",
you call (vl-bb-set 'ShutDown T). In your document reactor, you call
(vl-bb-ref 'ShutDown) in an if statment to decide whether to excecute the
rest of your code. If need be, you can place a balancing call to (vl-bb-ref)
in the commandCancelled reactor in case the user decides to cancel the
shutdown. Then your drawing reactors will still function the way you
designed them.

"Nick Jacobs" wrote in message
news:[email protected]...
> Hi Gang,
> I'm hoping somebody has found one now.....
>
> I've got document reactors running that sense a jump between drawings.
> (MDI). What I'm looking for is a way to STOP those reactors when a user
> does something that causes the system to exit AutoCAD. A good one is when
> the user hits the "X" to close down AutoCAD.
>
> (My document reactors tell the user when they switch to a "RAW" drawing
> versus a drawing that has been configured with project number and such.
We
> want to alert the user to this fact. Right now, you shut down Acad. The
> system will continue to display the warnings until all documents have been
> shut down.)
>
> Anybody have any ideas?
>
> Thanks,
> Nick
> Env: A2K/VC6/W2K
>
>
>
0 Likes
Message 3 of 13

Anonymous
Not applicable
Humm.... I wonder if the "X" fires a "QUIT" or if it tells the application
to do something else.... I'll look into that....

In any case, thanks for responding!!!!!!!!

Nick

"Frank Oquendo" wrote in message
news:[email protected]...
> How about this? In the CommandWillStart reactor, if the command us "QUIT",
> you call (vl-bb-set 'ShutDown T). In your document reactor, you call
> (vl-bb-ref 'ShutDown) in an if statment to decide whether to excecute the
> rest of your code. If need be, you can place a balancing call to
(vl-bb-ref)
> in the commandCancelled reactor in case the user decides to cancel the
> shutdown. Then your drawing reactors will still function the way you
> designed them.
>
> "Nick Jacobs" wrote in message
> news:[email protected]...
> > Hi Gang,
> > I'm hoping somebody has found one now.....
> >
> > I've got document reactors running that sense a jump between drawings.
> > (MDI). What I'm looking for is a way to STOP those reactors when a user
> > does something that causes the system to exit AutoCAD. A good one is
when
> > the user hits the "X" to close down AutoCAD.
> >
> > (My document reactors tell the user when they switch to a "RAW" drawing
> > versus a drawing that has been configured with project number and such.
> We
> > want to alert the user to this fact. Right now, you shut down Acad. The
> > system will continue to display the warnings until all documents have
been
> > shut down.)
> >
> > Anybody have any ideas?
> >
> > Thanks,
> > Nick
> > Env: A2K/VC6/W2K
> >
> >
> >
>
>
0 Likes
Message 4 of 13

Anonymous
Not applicable
What's not to respond? If I'm wrong, it was free in the first place. If I'm
right, I come up nice and shiny! 😃

"Nick Jacobs" wrote in message
news:[email protected]...
> Humm.... I wonder if the "X" fires a "QUIT" or if it tells the application
> to do something else.... I'll look into that....
>
> In any case, thanks for responding!!!!!!!!
>
> Nick
>
>
>
> "Frank Oquendo" wrote in message
> news:[email protected]...
> > How about this? In the CommandWillStart reactor, if the command us
"QUIT",
> > you call (vl-bb-set 'ShutDown T). In your document reactor, you call
> > (vl-bb-ref 'ShutDown) in an if statment to decide whether to excecute
the
> > rest of your code. If need be, you can place a balancing call to
> (vl-bb-ref)
> > in the commandCancelled reactor in case the user decides to cancel the
> > shutdown. Then your drawing reactors will still function the way you
> > designed them.
> >
> > "Nick Jacobs" wrote in message
> > news:[email protected]...
> > > Hi Gang,
> > > I'm hoping somebody has found one now.....
> > >
> > > I've got document reactors running that sense a jump between drawings.
> > > (MDI). What I'm looking for is a way to STOP those reactors when a
user
> > > does something that causes the system to exit AutoCAD. A good one is
> when
> > > the user hits the "X" to close down AutoCAD.
> > >
> > > (My document reactors tell the user when they switch to a "RAW"
drawing
> > > versus a drawing that has been configured with project number and
such.
> > We
> > > want to alert the user to this fact. Right now, you shut down Acad.
The
> > > system will continue to display the warnings until all documents have
> been
> > > shut down.)
> > >
> > > Anybody have any ideas?
> > >
> > > Thanks,
> > > Nick
> > > Env: A2K/VC6/W2K
> > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 13

Anonymous
Not applicable
Nick - Use VLR-DocManager-Reactor to detect opening/closing.

Nick Jacobs wrote:
>
> Hi Gang,
> I'm hoping somebody has found one now.....
>
> I've got document reactors running that sense a jump between drawings.
> (MDI). What I'm looking for is a way to STOP those reactors when a user
> does something that causes the system to exit AutoCAD. A good one is when
> the user hits the "X" to close down AutoCAD.
>
> (My document reactors tell the user when they switch to a "RAW" drawing
> versus a drawing that has been configured with project number and such. We
> want to alert the user to this fact. Right now, you shut down Acad. The
> system will continue to display the warnings until all documents have been
> shut down.)
>
> Anybody have any ideas?
>
> Thanks,
> Nick
> Env: A2K/VC6/W2K

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 6 of 13

Anonymous
Not applicable
Tony,
I'm already using that reactor to sense when I'm switching to and from the
documents. Actually, I had it set to DocumentBecameActive (or current or
which ever.) The problem is, when you do a shutdown of acad, all of the
documents become current for at least blip or so. Acad checks to see if the
document needs saved which fires the reactors.... yadayadayada.... It's
even more strange because if you put dialogs in your reactors (ala don't do
that kinda dialogs) then they'll show up AFTER the acadframe has shut
down... Kinda goofy...

Nick

"Tony Tanzillo" wrote in message
news:[email protected]...
> Nick - Use VLR-DocManager-Reactor to detect opening/closing.
>
> Nick Jacobs wrote:
> >
> > Hi Gang,
> > I'm hoping somebody has found one now.....
> >
> > I've got document reactors running that sense a jump between drawings.
> > (MDI). What I'm looking for is a way to STOP those reactors when a user
> > does something that causes the system to exit AutoCAD. A good one is
when
> > the user hits the "X" to close down AutoCAD.
> >
> > (My document reactors tell the user when they switch to a "RAW" drawing
> > versus a drawing that has been configured with project number and such.
We
> > want to alert the user to this fact. Right now, you shut down Acad. The
> > system will continue to display the warnings until all documents have
been
> > shut down.)
> >
> > Anybody have any ideas?
> >
> > Thanks,
> > Nick
> > Env: A2K/VC6/W2K
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* [email protected] */
> /* http://ourworld.compuserve.com/homepages/tonyt */
> /*********************************************************/
0 Likes
Message 7 of 13

Anonymous
Not applicable
And I appreciate it.

"Nick Jacobs" wrote in message
news:[email protected]...
> Hehehe, thanks Frank.
>
> I just like to say thanks where thanks is due. 🙂
>
> Sometimes people don't appreciate the contributions around this net
> thingy...... I just like to let people know that I do. Been that way since
> way back in the Compuserve days...
0 Likes
Message 8 of 13

Anonymous
Not applicable
Hehehe, thanks Frank.

I just like to say thanks where thanks is due. 🙂

Sometimes people don't appreciate the contributions around this net
thingy...... I just like to let people know that I do. Been that way since
way back in the Compuserve days...

Nick

"Frank Oquendo" wrote in message
news:[email protected]...
> What's not to respond? If I'm wrong, it was free in the first place. If
I'm
> right, I come up nice and shiny! 😃
>
> "Nick Jacobs" wrote in message
> news:[email protected]...
> > Humm.... I wonder if the "X" fires a "QUIT" or if it tells the
application
> > to do something else.... I'll look into that....
> >
> > In any case, thanks for responding!!!!!!!!
> >
> > Nick
> >
> >
> >
> > "Frank Oquendo" wrote in message
> > news:[email protected]...
> > > How about this? In the CommandWillStart reactor, if the command us
> "QUIT",
> > > you call (vl-bb-set 'ShutDown T). In your document reactor, you call
> > > (vl-bb-ref 'ShutDown) in an if statment to decide whether to excecute
> the
> > > rest of your code. If need be, you can place a balancing call to
> > (vl-bb-ref)
> > > in the commandCancelled reactor in case the user decides to cancel the
> > > shutdown. Then your drawing reactors will still function the way you
> > > designed them.
> > >
> > > "Nick Jacobs" wrote in message
> > > news:[email protected]...
> > > > Hi Gang,
> > > > I'm hoping somebody has found one now.....
> > > >
> > > > I've got document reactors running that sense a jump between
drawings.
> > > > (MDI). What I'm looking for is a way to STOP those reactors when a
> user
> > > > does something that causes the system to exit AutoCAD. A good one
is
> > when
> > > > the user hits the "X" to close down AutoCAD.
> > > >
> > > > (My document reactors tell the user when they switch to a "RAW"
> drawing
> > > > versus a drawing that has been configured with project number and
> such.
> > > We
> > > > want to alert the user to this fact. Right now, you shut down Acad.
> The
> > > > system will continue to display the warnings until all documents
have
> > been
> > > > shut down.)
> > > >
> > > > Anybody have any ideas?
> > > >
> > > > Thanks,
> > > > Nick
> > > > Env: A2K/VC6/W2K
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 9 of 13

Anonymous
Not applicable
I take it you're removing your reactor from
AcRx::kUnloadAppMsg/UnloadApplication().
Try handling AcDbEditorReactor::beginQuit() to see if it gets called
before the documentBecameCurrent(). If so, couldn't you set a global
variable and check that before starting your dialog...

Nick Jacobs wrote:
>
> Tony,
> I'm already using that reactor to sense when I'm switching to and from the
> documents. Actually, I had it set to DocumentBecameActive (or current or
> which ever.) The problem is, when you do a shutdown of acad, all of the
> documents become current for at least blip or so. Acad checks to see if the
> document needs saved which fires the reactors.... yadayadayada.... It's
> even more strange because if you put dialogs in your reactors (ala don't do
> that kinda dialogs) then they'll show up AFTER the acadframe has shut
> down... Kinda goofy...

|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
|
| e-mail: [email protected]
|
|
0 Likes
Message 10 of 13

Anonymous
Not applicable
Byron,

That's essentially what I'm trying to code right now.

I'm going to start out doing it with vl-reactors and then move it into an
arx file *hopefully* that is.

In any case,
Thanks for replying!!!!

Nick

"Byron Blattel" wrote in message
news:[email protected]...
> I take it you're removing your reactor from
> AcRx::kUnloadAppMsg/UnloadApplication().
> Try handling AcDbEditorReactor::beginQuit() to see if it gets called
> before the documentBecameCurrent(). If so, couldn't you set a global
> variable and check that before starting your dialog...
>
> Nick Jacobs wrote:
> >
> > Tony,
> > I'm already using that reactor to sense when I'm switching to and from
the
> > documents. Actually, I had it set to DocumentBecameActive (or current
or
> > which ever.) The problem is, when you do a shutdown of acad, all of the
> > documents become current for at least blip or so. Acad checks to see if
the
> > document needs saved which fires the reactors.... yadayadayada.... It's
> > even more strange because if you put dialogs in your reactors (ala don't
do
> > that kinda dialogs) then they'll show up AFTER the acadframe has shut
> > down... Kinda goofy...
>
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> |
> | e-mail: [email protected]
> |
> |
0 Likes
Message 11 of 13

Anonymous
Not applicable
Nick - Unfortunately Autodesk has left numerous defects in its APIs.

For example, the AcApDocManagerReactor is broken in several
regards. Here's what I have found:

1. The documentActivated() member does not fire when a
document is made active via the ActiveX API.

2. The documentToBeDestroyed() member never fires at all.

3. The documentActivationModifed() member does not fire
when it should, and sometimes fires when its shouldn't.

With defects like this, it's difficult to do anything without
being forced to using all sorts of insidious kludges.

Nick Jacobs wrote:
>
> Tony,
> I'm already using that reactor to sense when I'm switching to and from the
> documents. Actually, I had it set to DocumentBecameActive (or current or
> which ever.) The problem is, when you do a shutdown of acad, all of the
> documents become current for at least blip or so. Acad checks to see if the
> document needs saved which fires the reactors.... yadayadayada.... It's
> even more strange because if you put dialogs in your reactors (ala don't do
> that kinda dialogs) then they'll show up AFTER the acadframe has shut
> down... Kinda goofy...
>
> Nick
>
> "Tony Tanzillo" wrote in message
> news:[email protected]...
> > Nick - Use VLR-DocManager-Reactor to detect opening/closing.
> >
> > Nick Jacobs wrote:
> > >
> > > Hi Gang,
> > > I'm hoping somebody has found one now.....
> > >
> > > I've got document reactors running that sense a jump between drawings.
> > > (MDI). What I'm looking for is a way to STOP those reactors when a user
> > > does something that causes the system to exit AutoCAD. A good one is
> when
> > > the user hits the "X" to close down AutoCAD.
> > >
> > > (My document reactors tell the user when they switch to a "RAW" drawing
> > > versus a drawing that has been configured with project number and such.
> We
> > > want to alert the user to this fact. Right now, you shut down Acad. The
> > > system will continue to display the warnings until all documents have
> been
> > > shut down.)
> > >
> > > Anybody have any ideas?
> > >
> > > Thanks,
> > > Nick
> > > Env: A2K/VC6/W2K
> >
> > --
> > /*********************************************************/
> > /* Tony Tanzillo Design Automation Consulting */
> > /* Programming & Customization for AutoCAD & Compatibles */
> > /* ----------------------------------------------------- */
> > /* [email protected] */
> > /* http://ourworld.compuserve.com/homepages/tonyt */
> > /*********************************************************/

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 12 of 13

Anonymous
Not applicable
Tony,
Amen to that....... I've found some like that plus one or two when running
with W2K that make this interesting....

Nick

"Tony Tanzillo" wrote in message
news:[email protected]...
> Nick - Unfortunately Autodesk has left numerous defects in its APIs.
>
> For example, the AcApDocManagerReactor is broken in several
> regards. Here's what I have found:
>
> 1. The documentActivated() member does not fire when a
> document is made active via the ActiveX API.
>
> 2. The documentToBeDestroyed() member never fires at all.
>
> 3. The documentActivationModifed() member does not fire
> when it should, and sometimes fires when its shouldn't.
>
> With defects like this, it's difficult to do anything without
> being forced to using all sorts of insidious kludges.
>
> Nick Jacobs wrote:
> >
> > Tony,
> > I'm already using that reactor to sense when I'm switching to and from
the
> > documents. Actually, I had it set to DocumentBecameActive (or current
or
> > which ever.) The problem is, when you do a shutdown of acad, all of the
> > documents become current for at least blip or so. Acad checks to see if
the
> > document needs saved which fires the reactors.... yadayadayada.... It's
> > even more strange because if you put dialogs in your reactors (ala don't
do
> > that kinda dialogs) then they'll show up AFTER the acadframe has shut
> > down... Kinda goofy...
> >
> > Nick
> >
> > "Tony Tanzillo" wrote in message
> > news:[email protected]...
> > > Nick - Use VLR-DocManager-Reactor to detect opening/closing.
> > >
> > > Nick Jacobs wrote:
> > > >
> > > > Hi Gang,
> > > > I'm hoping somebody has found one now.....
> > > >
> > > > I've got document reactors running that sense a jump between
drawings.
> > > > (MDI). What I'm looking for is a way to STOP those reactors when a
user
> > > > does something that causes the system to exit AutoCAD. A good one
is
> > when
> > > > the user hits the "X" to close down AutoCAD.
> > > >
> > > > (My document reactors tell the user when they switch to a "RAW"
drawing
> > > > versus a drawing that has been configured with project number and
such.
> > We
> > > > want to alert the user to this fact. Right now, you shut down Acad.
The
> > > > system will continue to display the warnings until all documents
have
> > been
> > > > shut down.)
> > > >
> > > > Anybody have any ideas?
> > > >
> > > > Thanks,
> > > > Nick
> > > > Env: A2K/VC6/W2K
> > >
> > > --
> > > /*********************************************************/
> > > /* Tony Tanzillo Design Automation Consulting */
> > > /* Programming & Customization for AutoCAD & Compatibles */
> > > /* ----------------------------------------------------- */
> > > /* [email protected] */
> > > /* http://ourworld.compuserve.com/homepages/tonyt */
> > > /*********************************************************/
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* [email protected] */
> /* http://ourworld.compuserve.com/homepages/tonyt */
> /*********************************************************/
0 Likes
Message 13 of 13

Anonymous
Not applicable
Well Frank,
What you suggested works great for all normal messages.... What it doesn't
work with is the "X" way of shutting down AutoCAD (Close Type messages from
the system).....

Getting there..

Have you ever worked with the WinHook functions? I was looking at them as a
way to get the Quit Message and the turning off reactors...

What do ya think?
Nick

"Frank Oquendo" wrote in message
news:[email protected]...
> And I appreciate it.
>
> "Nick Jacobs" wrote in message
> news:[email protected]...
> > Hehehe, thanks Frank.
> >
> > I just like to say thanks where thanks is due. 🙂
> >
> > Sometimes people don't appreciate the contributions around this net
> > thingy...... I just like to let people know that I do. Been that way
since
> > way back in the Compuserve days...
>
>
0 Likes