Acad Aplication Level Events

Discussion in 'AutoCAD' started by Mark Gardiner, Apr 30, 2004.

  1. Hi All

    I was wanting to get application level envents starting automatically without the use of lisp & (Defun S::STARTUP() )
    What I found was thet using
    Set ACADApp = GetObject(, "AutoCAD.Application.16")
    in the macro AcadStartUp was not actually setting AcadApp and hence no document level events were being raised. I found using
    Set ACADApp = AcadApplication
    set AcadApp correctly.


    'This code is placed in a macro called 'AcadStartUp' in 'Thisdrawing' in a VBA Project 'acad.dvb' on the support path. This DVB project will load automatically & run the macro AcadStartUp
    '''''''''''''''''''''''''''''''
    Option Explicit
    Public WithEvents AcadApp As AcadApplication
    '
    Public Sub AcadStartUp()
    Set AcadApp = AcadApplication
    End Sub
    ''''''''''''''''''''''''''''
    You also need to have 'acadvba.arx' for 2000 & 200i & 2002 & 'acvba.arx' for 2004 (& 2005 ?) loaded for events to be raised in VBA this can be done with file 'cad.rx' on you support path contsining a line with either 'acadvba.arx' or 'acvba.arx'
     
    Mark Gardiner, Apr 30, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.