Managing multiple document's events in .NET

Discussion in 'AutoCAD' started by Mike Tuersley, Feb 10, 2005.

  1. Has anyone worked out how to manage doc events across docs in .NET? I can't
    seem to get the old vb6 method of an array of documents withevents to work.

    TIA
    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Feb 10, 2005
    #1
  2. mike,

    you can iterate through the AcadApplication.Documents to get every open drawing (<tDoc>) and then call

    AddHandler tDoc.ObjectModified, AddressOf YourSubName

    to assign a sub to be called when the event from the document is fired.
    be carefull to watch the AcadApplication for opening/closing/creating drawings. in case of documents where closed you can (you have to) remove the
    eventhandler with

    RemoveHandler .... (same syntax like AddHandler)

    - alfred -
     
    Alfred NESWADBA, Feb 10, 2005
    #2
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.