这种组合,实现只在"AA1"图层中,找line实体. fType(0) = -4: fData(0) = "<And" fType(2) = 0: fData(2) = "text" fType(1) = 8: fData(1) = "AA1" fType(3) = -4: fData(3) = "And>"
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) = "<And" fType(2) = 0: fData(2) = "text" fType(1) = 8: fData(1) = "标题栏" fType(3) = -4: fData(3) = "And>" sSet.Select 5, , , fType, fData sSet.Highlight True 'Debug.Print sSet.Count End With End Sub '''这种组合是图层aa1中的line和text实体 fType(0) = -4: fData(0) = "<Or" fType(1) = 8: fData(1) = "AA1" fType(2) = -4: fData(2) = "Or>" fType(3) = -4: fData(3) = "<Or" fType(4) = 0: fData(4) = "Line" fType(5) = 0: fData(5) = "Text"
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) = "<Or" fType(1) = 8: fData(1) = "AA1" fType(2) = -4: fData(2) = "Or>" fType(3) = -4: fData(3) = "<Or" fType(4) = 0: fData(4) = "Line" fType(5) = 0: fData(5) = "Text" fType(6) = -4: fData(6) = "Or>" sSet.Select 5, , , fType, fData Debug.Print sSet.Count sSet.Highlight True End With End Sub
|