- 积分
- 777
- 明经币
- 个
- 注册时间
- 2004-8-31
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我已经通过选择集过滤选择了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, "<or", 0, "text", 0, "mtext", _ 0, "AcDbAlignedDimension", 0, "AcDbRotatedDimension", -4, "or>" 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 |
|