Author Topic: The BeginQuit event  (Read 3163 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
The BeginQuit event
« on: June 05, 2005, 08:01:31 AM »
Morning Folks,

I’m desperately trying to get into VBA as quick as possible, so I’m not depending on my lisp skills only.

I need to understand how the “BeginQuit” Handler works, since I write a VBA program that must start when acad quits.

Anybody out there who can help??

Bernd
Bernd

Dnereb

  • Guest
The BeginQuit event
« Reply #1 on: June 11, 2005, 07:01:09 AM »
Hi , Bernd

I suppose you mean the BeginClose event for a document.
"BeginQuit" is not availeble in vba

If you open the VBA IDE (left Alt-F11)
you'll see ThisDrawing in your project browser. double click it and place this code:

Option Explicit
Code: [Select]

Private Sub AcadDocument_BeginClose()

'do your stuff

End Sub


This will fire just before the document is closed. Acad itself will remain running.

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
The BeginQuit event
« Reply #2 on: June 14, 2005, 08:45:40 AM »
I'm searching for a event that fires when Acad is shut down. End of the day, drafter goes home and has to fill in a form.

Are you sure there is no VBA event for? I know that there is no vlisp event for in A2002, in 2006 it works with the command reactor for quit, but in my company we change only next year, so i need something for A2002.

Bernd
Bernd

Jeff_M

  • King Gator
  • Posts: 4048
  • C3D user & customizer
The BeginQuit event
« Reply #3 on: June 14, 2005, 01:26:50 PM »
Quote from: Decent

I suppose you mean the BeginClose event for a document.
"BeginQuit" is not availeble in vba

Decent & Bernd, for both of your benefit here is a snip from the VBA Developer Reference in R2002
Quote from: AcadHelp

BeginQuit Event

Triggered just before an AutoCAD session ends or a document closes.

See Also | Example

Signature

object.BeginQuit (Cancel)
object

Application
An object expression that evaluates to a valid container object. In this case, the only valid container is the application.

Cancel

Boolean; output from the handler

TRUE: Aborts the shutdown of AutoCAD.

FALSE: Allows the shutdown of AutoCAD to continue.

Remarks

The BeginQuit event marks the end of the AutoCAD session.

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
The BeginQuit event
« Reply #4 on: June 15, 2005, 09:18:14 AM »
:D Jeff, you saved my ass.


Thanks a lot, that approach works.
Bernd