Message 1 of 11
Public Function does return SS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following code snippet is located within in my form level module in a cmd button click event.
For i = 0 To lstOpenDwgs.ListCount - 1
Application.Documents.Item(lstOpenDwgs.List(i)).Activate
Set ssPlineCorrals = getPolyLineBlockCorrals()
MsgBox ssPlineCorrals.Count
Next
The Public function getPolyLineBlockCorrals doesn't return the selection set to ssPlineCorrals variable. The selection set is getting created but doesn't make back to the form code.
What am I missing?
Dim FilterType(0 To 2) As Integer
Dim FilterData(0 To 2) As Variant
FilterType(0) = 8
FilterData(0) = "ContNum"
FilterType(1) = 0
FilterData(1) = "INSERT"
FilterType(2) = 2
FilterData(2) = "`*U*"
' set an error trap for failed selection set calls
On Error Resume Next
Set objSS = ThisDrawing.SelectionSets("test2corrals")
If Err = 0 Then
objSS.Clear
Else
Set objSS = ThisDrawing.SelectionSets.Add("test2corrals")
End If
objSS.Select acSelectionSetAll, , , FilterType, FilterData
objSS.Highlight True
MsgBox objSS.Count ' test line
End Function
For i = 0 To lstOpenDwgs.ListCount - 1
Application.Documents.Item(lstOpenDwgs.List(i)).Activate
Set ssPlineCorrals = getPolyLineBlockCorrals()
MsgBox ssPlineCorrals.Count
Next
The Public function getPolyLineBlockCorrals doesn't return the selection set to ssPlineCorrals variable. The selection set is getting created but doesn't make back to the form code.
What am I missing?
Dim FilterType(0 To 2) As Integer
Dim FilterData(0 To 2) As Variant
FilterType(0) = 8
FilterData(0) = "ContNum"
FilterType(1) = 0
FilterData(1) = "INSERT"
FilterType(2) = 2
FilterData(2) = "`*U*"
' set an error trap for failed selection set calls
On Error Resume Next
Set objSS = ThisDrawing.SelectionSets("test2corrals")
If Err = 0 Then
objSS.Clear
Else
Set objSS = ThisDrawing.SelectionSets.Add("test2corrals")
End If
objSS.Select acSelectionSetAll, , , FilterType, FilterData
objSS.Highlight True
MsgBox objSS.Count ' test line
End Function