×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Visual Basic
Posted by: Stephan Gumpert
Added: Sep 9, 2013 5:11 AM
Views: 38
  1. Using trans As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction
  2.     Try
  3.         For Each selObj In acSSet
  4.             Select Case selObj.ObjectId.ObjectClass.Name
  5.                 Case "AcDbText"
  6.                     Dim textObj As DBText = trans.GetObject(selObj.ObjectId, OpenMode.ForRead, False, True)
  7.                     MsgBox("Text = " & textObj.TextString)
  8.                     textObj.Dispose()
  9.                 Case "AcDbMText"
  10.                     Dim mtextObj As MText = trans.GetObject(selObj.ObjectId, OpenMode.ForRead, False, True)
  11.                     MsgBox("Text = " & mtextObj.Contents)
  12.                     mtextObj.Dispose()
  13.             End Select
  14.         Next selObj
  15.     Catch ex As Exception
  16.     Finally
  17.         trans.Commit()
  18.     End Try
  19. End Using