|
我已经通过选择集过滤选择了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.Number 0 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 |
|