Thanks for the tips...
My issue is this:
I have a program that adds rows to a table and also fills rows with text. I have each of these within their own transaction. For some reason, when I undo, it is not seeing these transactions as seperate "tasks". For example, if I add 3 rows and insert text in another and then undo, it undoes everything...
Here is the code I have. These this behind buttons on a palette. To give it a try, you will need a table with 5 columns. Insert a few rows and then undo. Thanks again for the help.
'setup variable
Dim editor As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim pOptions As PromptEntityOptions = New PromptEntityOptions("Select a table: ")
Dim pResults As PromptEntityResult = editor.GetEntity(pOptions)
Dim tbl As Table
Dim trans As Transaction
'start the transaction
trans = HostApplicationServices.WorkingDatabase().TransactionManager.StartTransaction()
Try
'lock the document
editor.Document.LockDocument()
'get the object and open it for write
tbl = trans.GetObject(pResults.ObjectId, OpenMode.ForWrite)
Dim ht As TableHitTestInfo
ht = tbl.HitTest(pResults.PickedPoint, Vector3d.ZAxis)
'add the strings
tbl.SetTextString(ht.Row, 1, "test 1")
tbl.SetTextString(ht.Row, 2, "test 1")
tbl.SetTextString(ht.Row, 3, "test 1")
tbl.SetTextString(ht.Row, 4, "test 1")
'commit the changes
trans.Commit()
Catch
Finally
'dispose the transaction
trans.Dispose()
End Try