Message 1 of 11
Problem with SelectionSets

Not applicable
06-06-2006
01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
the code of my procedure is:
Public Function GetLayerEnts(sLayrName As String) As AcadSelectionSet
Dim iType(0) As Integer
Dim vData(0) As Variant
Dim sSet As AcadSelectionSet
On Error Resume Next
Set sSet = MyDrawing.SelectionSets("sel" & sLayrName)
If err Then Set sSet = MyDrawing.SelectionSets.Add("sel" & sLayrName)
sSet.Clear
iType(0) = 8
vData(0) = sLayrName
sSet.Select acSelectionSetAll, FilterType:=iType, FilterData:=vData
If Not sSet Is Nothing Then
Set GetLayerEnts = sSet
End If
End Function
I call this procedure more than 60 times(one for each layer of my drawing) and there is one momment in which Sset returns Nothing despite there should be entities in the selection set. I don't know why this is happenning.
Please, can anybody help me?? it's driving me crazy.
the code of my procedure is:
Public Function GetLayerEnts(sLayrName As String) As AcadSelectionSet
Dim iType(0) As Integer
Dim vData(0) As Variant
Dim sSet As AcadSelectionSet
On Error Resume Next
Set sSet = MyDrawing.SelectionSets("sel" & sLayrName)
If err Then Set sSet = MyDrawing.SelectionSets.Add("sel" & sLayrName)
sSet.Clear
iType(0) = 8
vData(0) = sLayrName
sSet.Select acSelectionSetAll, FilterType:=iType, FilterData:=vData
If Not sSet Is Nothing Then
Set GetLayerEnts = sSet
End If
End Function
I call this procedure more than 60 times(one for each layer of my drawing) and there is one momment in which Sset returns Nothing despite there should be entities in the selection set. I don't know why this is happenning.
Please, can anybody help me?? it's driving me crazy.