I am pretty new to .net and am having some issues with transactions (I
think)...
I want to add a row to an existing table. AutoCAD crashes when I try to
open the object for write. Am I using the transaction improperly?
Here is the code I have so far:
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
trans =
HostApplicationServices.WorkingDatabase().TransactionManager.StartTransaction()
tbl = trans.GetObject(pResults.ObjectId, OpenMode.ForWrite) <----
****crashes here****
tbl.InsertRows(1, 1.0, 1)
trans.Commit()
trans.Dispose()
Thanks for the help,
--
Joel Roderick
Water Technology, Inc.
www.watertechnologyinc.com