好久没用VB了- <CommandMethod("vt1")> _
- Public Sub Test1()
- Dim doc = Application.DocumentManager.MdiActiveDocument
- Dim ed = doc.Editor
- Dim db = doc.Database
- Dim resSel = ed.GetSelection(New SelectionFilter(New TypedValue() {New TypedValue(0, "text")}))
- If (resSel.Status <> PromptStatus.OK) Then Return
- Using tr = db.TransactionManager.StartTransaction
- For Each id As ObjectId In resSel.Value.GetObjectIds()
- Dim txt As DBText = tr.GetObject(id, OpenMode.ForRead)
- ed.WriteMessage(vbCrLf + txt.TextString)
- Next
- End Using
- End Sub
|