Thanks again for your input, I do apprechiate you guys taking the time to answer me.
I suspect though that I was not as clear as I could be on what the problem is. Maybe some code would help out here to highlight where I am? I have added some code below below that shows my basic setup, obviously my creation of data is a bit more involved and data is appended as XRecords but it demostrates the problem. If you move with the cursor the line (after running DrawData) you will see the two messages (Entity Modified & Command Ended), however Properties Palette changes will only give the 'Entity Modified' message as the commanded ended in not thrown.
Public Class App
Implements Autodesk.AutoCAD.Runtime.IExtensionApplication
''' <summary>
''' Start app
''' </summary>
Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
'For now we will Greet the user
ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbNewLine + "Welcome to My Test App!" + vbNewLine)
'Add handler for CommandEnded
AddHandler ApplicationServices.Application.DocumentManager.MdiActiveDocument.CommandEnded, AddressOf CommandEnded
End Sub
''' <summary>
''' End App
''' </summary>
''' <remarks></remarks>
Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
'Do something....
End Sub
''' <summary>
''' Entity has been modified
''' </summary>
Public Sub EntityModified(ByVal senderObj As Object, ByVal evtArgs As EventArgs)
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbNewLine + "Entity Changed" + vbNewLine)
'Store the Entity ID
End Sub
''' <summary>
''' Command Has Ended
''' </summary>
Public Sub CommandEnded(sender As Object, e As CommandEventArgs)
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbNewLine + "Command Ended" + vbNewLine)
'Process the list of Entity IDs
End Sub
''' <summary>
''' Draw my data and add handlers
''' </summary>
<CommandMethod("DrawData")> _
Public Sub DrawData()
Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim l As Line
'Lock the document and start a new transation
Using dl As DocumentLock = acDoc.LockDocument()
Using myTrans As Transaction = acDoc.TransactionManager.StartTransaction()
' Open Model space for write
Using acBlkTbl As BlockTable = CType(myTrans.GetObject(acDoc.Database.BlockTableId, OpenMode.ForRead), BlockTable)
Using acBlkTblRec As BlockTableRecord = CType(myTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
'Draw the entities in loop (for example)
'Just adding a single line here
l = New Line(New Geometry.Point3d(1, 1, 0), New Geometry.Point3d(100, 100, 0))
'Assign to the layer zero
l.LayerId = acDoc.Database.LayerZero
'Add handlers (only one added in demo)
AddHandler l.Modified, AddressOf EntityModified
acBlkTblRec.AppendEntity(l)
myTrans.AddNewlyCreatedDBObject(l, True)
myTrans.Commit()
End Using
End Using
End Using
End Using
End Sub
End Class
As you can see the events are all hooked up so I know exactly what changes are happening and I store these. I then process these chanegs at once in the CommandEnded event handler. However This is NOT thrown when a change is made on the properties box so this is where my code falls down.
What I need to find is another event to handle other than command ended (DocumentManager.DocumentLockModeWillChange & Editor.EnteringQuiescentState are not working for me either). Or some way of telling that an change occur as a result of the Properties box (i.e. not part of a command).
Does that help?