|
这种组合,实现只在"AA1"图层中,找line实体.
fType(0) = -4: fData(0) = ""
Sub l()
Dim sSet As AcadSelectionSet
Dim fType(3) As Integer, fData(3) As Variant
Dim sSetName As String
sSetName = "First"
With ThisDrawing
On Error Resume Next
If Not IsNull(.SelectionSets.Item(sSetName)) Then
Set sSet = .SelectionSets.Item(sSetName)
sSet.Delete
End If
Set sSet = .SelectionSets.Add(sSetName)
fType(0) = -4: fData(0) = ""
sSet.Select 5, , , fType, fData
sSet.Highlight True
'Debug.Print sSet.Count
End With
End Sub
'''这种组合是图层aa1中的line和text实体
fType(0) = -4: fData(0) = ""
fType(3) = -4: fData(3) = "
Sub ls()
Dim sSet As AcadSelectionSet
Dim fType(6) As Integer, fData(6) As Variant
Dim sSetName As String
sSetName = "First"
With ThisDrawing
On Error Resume Next
If Not IsNull(.SelectionSets.Item(sSetName)) Then
Set sSet = .SelectionSets.Item(sSetName)
sSet.Delete
End If
Set sSet = .SelectionSets.Add(sSetName)
fType(0) = -4: fData(0) = ""
fType(3) = -4: fData(3) = ""
sSet.Select 5, , , fType, fData
Debug.Print sSet.Count
sSet.Highlight True
End With
End Sub
|
|