§Standard db access with Transactions
§Public
Function MyFunc()
§ ‘Get the database current in AutoCAD
§ Dim db As Database =
HostApplicationServices.WorkingDatabase()
§
§ ‘Start a transaction
using the database transaction manager
§ Using trans As Transaction =
db.TransactionManager.StartTransaction()
§ ‘Do all
database operations here
§ ‘Lets get the block table
from the database
§ ‘Drill
into the database and obtain a reference to the BlockTable
§ Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite)
§ ‘Everything successful, so commit the transaction
§ trans.commit()
§ End Using
§End
Function