tjdxtm 发表于 2004-11-3 15:45:00

[VBA]请教一个关于取得文本内容的问题

我已经通过选择集过滤选择了text和mtext,我怎样取得每个文本的内容呢?
哪位高手给段代码,谢谢了。
Option Explicit
Public SSetObj As AcadSelectionSet
Private Sub www()
                       Dim fType As Variant
                       Dim fData As Variant
                                               
                       On Error Resume Next
                       Set SSetObj = ThisDrawing.SelectionSets("test")
                       If Err.Number0 Then
                                                       Err.Clear
                                                       Set SSetObj = ThisDrawing.SelectionSets.Add("test")
                       End If
                       SSetObj.Clear
                       BuildFilter fType, fData, -4, ""
                       SSetObj.SelectOnScreen fType, fData

End Sub
Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes())
                       Dim fType() As Integer, fData()
                       Dim index As Long, i As Long
                               
                       index = LBound(gCodes) - 1
                                                               
                       For i = LBound(gCodes) To UBound(gCodes) Step 2
                                                       index = index + 1
                                                       ReDim Preserve fType(0 To index)
                                                       ReDim Preserve fData(0 To index)
                                                       fType(index) = CInt(gCodes(i))
                                                       fData(index) = gCodes(i + 1)
                       Next
                       typeArray = fType: dataArray = fData
End Sub

雪山飞狐_lzh 发表于 2004-11-3 17:57:00

http://www.vba.cn/object/acad2004/idh_textstring.htm
http://www.vba.cn/object/acad2004/idh_textoverride.htm
页: [1]
查看完整版本: [VBA]请教一个关于取得文本内容的问题