Message 1 of 10
Help with Selection set in VB
Not applicable
05-23-2006
10:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, here is the story, I have copied this piece of code from this same forum & I’m using it in VB NOT VBA, (it works fine under AutoCAD VBA) for some odd reason some stuff won’t work. I have noted the things that aren’t working on the code. Thanks in advance for your help.
William
Dim SelSet As AcadSelectionSet
Dim FilterType(0 To 0) As Integer
Dim FilterData(0 To 0) As Object
Dim blk As AcadEntity
AcadDoc.SelectionSets.Add("SelSet")
*-*-*-* ‘I GET THE SQUIGLEE LINES HERE-*-*-*-*
SelSet = AcadDoc.SelectionSets("SelSet")
SelSet.Clear()
FilterType(0) = 0
FilterData(0) = "INSERT"
*-*-*-* ‘I GET AN INVALID FILTERTYP OR FILTERDATA -*-*-*-*
SelSet.Select(AcSelect.acSelectionSetAll, , , FilterType, FilterData)
'SelSet.SelectOnScreen(FilterType, FilterData)
If SelSet.Count = 0 Then Exit Sub
For Each blk In SelSet
MsgBox(blk.ObjectName)
Next
William
Dim SelSet As AcadSelectionSet
Dim FilterType(0 To 0) As Integer
Dim FilterData(0 To 0) As Object
Dim blk As AcadEntity
AcadDoc.SelectionSets.Add("SelSet")
*-*-*-* ‘I GET THE SQUIGLEE LINES HERE-*-*-*-*
SelSet = AcadDoc.SelectionSets("SelSet")
SelSet.Clear()
FilterType(0) = 0
FilterData(0) = "INSERT"
*-*-*-* ‘I GET AN INVALID FILTERTYP OR FILTERDATA -*-*-*-*
SelSet.Select(AcSelect.acSelectionSetAll, , , FilterType, FilterData)
'SelSet.SelectOnScreen(FilterType, FilterData)
If SelSet.Count = 0 Then Exit Sub
For Each blk In SelSet
MsgBox(blk.ObjectName)
Next