Message 1 of 5
Remove Items from selection Set (Novice Question)

Not applicable
01-13-2006
06:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, can someone please help me here!!!
Just as an exercise, I am trying to create a Selection Set, and then Remove all Items from the set. Everything seems to work fine until I execute the RemoveItems Method. When I do, I get a "Invalid argument Items in RemoveItems" error.
Can anybody tell me what I am doing wrong here???
Public Sub ChangePath()
Dim SelRefs As AcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
Set SelRefs = ThisDrawing.SelectionSets.Add("SEL_REFS")
FilterType(0) = 0
FilterData(0) = "INSERT"
SelRefs.Select acSelectionSetAll, , , FilterType, FilterData
ReDim entObj(0 To SelRefs.Count - 1) As Variant
Dim i As Integer
For i = 0 To SelRefs.Count - 1
Set entObj(i) = SelRefs.Item(i)
Next i
SelRefs.RemoveItems entObj
SelRefs.Delete
End Sub
Just as an exercise, I am trying to create a Selection Set, and then Remove all Items from the set. Everything seems to work fine until I execute the RemoveItems Method. When I do, I get a "Invalid argument Items in RemoveItems" error.
Can anybody tell me what I am doing wrong here???
Public Sub ChangePath()
Dim SelRefs As AcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
Set SelRefs = ThisDrawing.SelectionSets.Add("SEL_REFS")
FilterType(0) = 0
FilterData(0) = "INSERT"
SelRefs.Select acSelectionSetAll, , , FilterType, FilterData
ReDim entObj(0 To SelRefs.Count - 1) As Variant
Dim i As Integer
For i = 0 To SelRefs.Count - 1
Set entObj(i) = SelRefs.Item(i)
Next i
SelRefs.RemoveItems entObj
SelRefs.Delete
End Sub