<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Document Change Event in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934280#M61728</link>
    <description>&lt;P&gt;thanks for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;but i am asking for if a document is active and i change some thing in drawing. how i can raise an event at that time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;for example i have a dwg and its active doc and i add a circle or remove a triangle from it how i can notify user that some thing has changed in the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2011 16:23:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-01T16:23:22Z</dc:date>
    <item>
      <title>Document Change Event</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2933770#M61726</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How i can detect that an active&amp;nbsp;document is changed and fire an event to notify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 11:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2933770#M61726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T11:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Document Change Event</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934006#M61727</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.ApplicationServices
Imports AcApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class VbExtApp
    Implements Autodesk.AutoCAD.Runtime.IExtensionApplication

    Private DocMan As DocumentCollection

    'Initialize sub
    Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize

        DocMan = AcApp.DocumentManager

        AddHandler DocMan.DocumentActivated, AddressOf callback_documentActivated
        AddHandler DocMan.DocumentCreated, AddressOf callback_documentCreated

    End Sub

    'Terminate sub
    Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
        RemoveHandler DocMan.DocumentCreated, AddressOf callback_documentActivated
        RemoveHandler DocMan.DocumentCreated, AddressOf callback_documentCreated
    End Sub

    Private Sub callback_documentCreated(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs)
        If e.Document = Nothing Then
            Exit Sub
        Else
            MsgBox("Created")
        End If
    End Sub

    Private Sub callback_documentActivated(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs)
        If e.Document = Nothing Then
            Exit Sub
        Else
            MsgBox("Activated")
        End If
    End Sub
End Class&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 14:23:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934006#M61727</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2011-03-01T14:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Document Change Event</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934280#M61728</link>
      <description>&lt;P&gt;thanks for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;but i am asking for if a document is active and i change some thing in drawing. how i can raise an event at that time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;for example i have a dwg and its active doc and i add a circle or remove a triangle from it how i can notify user that some thing has changed in the drawing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 16:23:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934280#M61728</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T16:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Document Change Event</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934408#M61729</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.ApplicationServices
Imports AcApp = Autodesk.AutoCAD.ApplicationServices.Application

Public Class VbExtApp
    Implements Autodesk.AutoCAD.Runtime.IExtensionApplication

    Private DocMan As DocumentCollection
    Private db As Database

    'Initialize sub
    Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize

        DocMan = AcApp.DocumentManager

        AddHandler DocMan.DocumentActivated, AddressOf callback_documentActivated
        AddHandler DocMan.DocumentCreated, AddressOf callback_documentCreated
        ' get First Open Drawing
        initEvents()

    End Sub

    Sub initEvents()
        For Each doc In DocMan
            Dim db As Database = doc.Database
            AddHandler db.ObjectAppended, AddressOf callback_ObjectAppended
            AddHandler db.ObjectErased, AddressOf callback_ObjectErased
            AddHandler db.ObjectModified, AddressOf callback_ObjectModified
        Next
    End Sub

    Private Sub callback_ObjectAppended(ByVal sender As Object, ByVal e As ObjectEventArgs)
        MsgBox(e.DBObject.ToString() &amp;amp; "-Appended")
    End Sub

    Private Sub callback_ObjectErased(ByVal sender As Object, ByVal e As ObjectErasedEventArgs)
        MsgBox(e.DBObject.ToString() &amp;amp; "-Erased")
    End Sub
    Private Sub callback_ObjectModified(ByVal sender As Object, ByVal e As ObjectEventArgs)
        MsgBox(e.DBObject.ToString() &amp;amp; "-Modified")
    End Sub

    'Terminate sub
    Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
        RemoveHandler DocMan.DocumentCreated, AddressOf callback_documentActivated
        RemoveHandler DocMan.DocumentCreated, AddressOf callback_documentCreated
        ' Not sure if this is needed
        RemoveHandler db.ObjectAppended, AddressOf callback_ObjectAppended
        RemoveHandler db.ObjectErased, AddressOf callback_ObjectErased
        RemoveHandler db.ObjectModified, AddressOf callback_ObjectModified
    End Sub


    Private Sub callback_documentCreated(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs)
        initEvents()
    End Sub

    Private Sub callback_documentActivated(ByVal sender As Object, ByVal e As DocumentCollectionEventArgs)
        initEvents()
    End Sub
End Class&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 17:24:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934408#M61729</guid>
      <dc:creator>arcticad</dc:creator>
      <dc:date>2011-03-01T17:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Document Change Event</title>
      <link>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934434#M61731</link>
      <description>&lt;P&gt;thanks i will try that&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 17:27:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/document-change-event/m-p/2934434#M61731</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-01T17:27:37Z</dc:date>
    </item>
  </channel>
</rss>

