|
tiancao1001 于 2024-05-26 01:51 PM 发表评论:
Public Sub TcTxtDaoXu()
On Error Resume Next
Dim acDc As Document = Application.DocumentManager.MdiActiveDocument
Dim acDb As Database = acDc.Database
Dim acTypValAr(0) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.Start, "TEXT"), 0)
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)
Dim acSSPrompt As PromptSelectionResult = acDc.Editor.GetSelection(acSelFtr)
If acSSPrompt.Status = PromptStatus.OK Then '选择成功
Dim acSS As SelectionSet = acSSPrompt.Value
For Each id As ObjectId In acSS.GetObjectIds
Using acTrans As Transaction = acDb.TransactionManager.StartTransaction()
Dim acTxt As DBText = acTrans.GetObject(id, OpenMode.ForWrite)
Dim str As String = acTxt.TextString
Dim strArr As Char() = str.ToCharArray
Array.Reverse(strArr)
Dim NewStr As New String(strArr)
acTxt.TextString = NewStr
acTrans.Commit()
End Using
Next
End If
End Sub
发表评论 - 不要忘了输入验证码哦! |