- Sub SelectBlock()
- Dim ss As AcadSelectionSet
- On Error Resume Next
- Set ss = ThisDrawing.SelectionSets.Add("mccad")
- If Err Then
- Set ss = ThisDrawing.SelectionSets("mccad")
- ss.Clear
- End If
- Dim fType(1) As Integer
- Dim fData(1) As Variant
- fType(0) = 0
- fData(0) = "INSERT" '此处为块引用的图元类型
- fType(1) = 2
- fData(1) = "mccad" '此处为块引用的名称
- ss.Select acSelectionSetAll, , , fType, fData
- ss.Highlight (True)
- MsgBox "亮显的对象为满足条件的图块对象," _
- & vbCrLf & vbCrLf & "总数: " & ss.Count, , _
- "明经通道VBA示例"
- ss.Highlight (False)
- End Sub
|