Using doc.LockDocument()
Using acTrans As Transaction = db.TransactionManager.StartTransaction
' no need for the while loop and I think it confuses things a bit...
Dim SSet As PromptSelectionResult = ed.GetSelection(pso, IntvolFilter)
If (SSet.Status = PromptStatus.OK) Then
For Each selObj As SelectedObject In SSet.Value
Dim sent As Entity = DirectCast(acTrans.GetObject(selObj.ObjectId, OpenMode.ForRead), Entity)
If TypeOf sent Is BlockReference Then
_currentBlockReference = DirectCast(sent, BlockReference)
'we have the block, might as well get it done here,
'NOTE: these variables will be reset each for each iteration!!
If _currentBlockReference Is Nothing = False Then
Me.txtCurrent.Text = GetDataFromIntVol(_currentBlockReference, acTrans)
Me.txtProposed.Text = GetDataFromIntVol(_currentBlockReference, acTrans, cbxConvertTo.SelectedIndex)
End If
End If
Next
ElseIf (SSet.Status = PromptStatus.Error) Then
ed.WriteMessage(vbCrLf & My.Resources._MustBeIntersection)
ElseIf (SSet.Status <> PromptStatus.OK) Then
Exit While
End If
acTrans.Commit()
End Using
End Using