本帖最后由 作者 于 2008-12-9 16:08:48 编辑
liminnet发表于2008-12-1 15:52:00拍马屁的时候来啦(sssget '((-4 . <OR) (8 . 0) (-4 . OR>) (-4 . <OR) (0 . LINE) (-4 . OR>)))
用了and方法 Sub l() Dim sSet As AcadSelectionSet Dim fType(3) As Integer, fData(3) As Variant Dim sSetName As String sSetName = "First" With ConnectCad With .ActiveDocument 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) End With fType(0) = -4: fData(0) = "<And" fType(2) = 0: fData(2) = "Line" fType(1) = 8: fData(1) = "标题栏" fType(3) = -4: fData(3) = "And>" sSet.Select 5, , , fType, fData sSet.Erase 'Debug.Print sSet.Count End With End Sub 用or选8图层 再连上or选0图元的方法 Sub l() Dim sSet As AcadSelectionSet Dim fType(6) As Integer, fData(6) As Variant Dim sSetName As String sSetName = "First" With ConnectCad With .ActiveDocument 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) End With fType(0) = -4: fData(0) = "<Or" fType(1) = 8: fData(1) = "标题栏" fType(2) = -4: fData(2) = "Or>" fType(3) = -4: fData(3) = "<Or" fType(4) = 0: fData(4) = "Line" 'fType(5) = -4: fData(5) = "Or>" 'fType(6) = -4: fData(6) = "Or<" fType(5) = 0: fData(5) = "Text" fType(6) = -4: fData(6) = "Or>" 'fType(6) = -4: fData(6) = "And>" sSet.Select 5, , , fType, fData Debug.Print sSet.Count sSet.Erase End With End Sub
|