Message 1 of 3
Problem with selectionset

Not applicable
02-15-2009
12:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
can anybody tell me why is it the Count =0 instead of 3?
Public Sub test()
Dim selSet As AcadSelectionSet
Dim FType As Variant
Dim FData As Variant
Dim PLObject As AcadPolyline
ReDim FType(1) As Integer
ReDim FData(1) As Variant
If ThisDrawing.SelectionSets.Count = 0 Then Set selSet = ThisDrawing.SelectionSets.Add("New") Else Set selSet = ThisDrawing.SelectionSets(0)
selSet.Clear
FType(0) = 0: FData(0) = "POLYLINE"
FType(1) = 8: FData(1) = "Pline"
Call selSet.Select(acSelectionSetAll, , , FType, FData)
Set PLObject = selSet(0)
selSet.Clear
ReDim FType(2) As Integer
ReDim FData(2) As Variant
FType(0) = 0: FData(0) = "TEXT"
FType(1) = 1: FData(1) = "xy"
FType(2) = 8: FData(2) = "Text"
Call selSet.SelectByPolygon(acSelectionSetCrossingPolygon, PLObject.Coordinates, FType, FData)
Debug.Print ("Count: " + CStr(selSet.Count))
End Sub
Thanks!
szab0a
can anybody tell me why is it the Count =0 instead of 3?
Public Sub test()
Dim selSet As AcadSelectionSet
Dim FType As Variant
Dim FData As Variant
Dim PLObject As AcadPolyline
ReDim FType(1) As Integer
ReDim FData(1) As Variant
If ThisDrawing.SelectionSets.Count = 0 Then Set selSet = ThisDrawing.SelectionSets.Add("New") Else Set selSet = ThisDrawing.SelectionSets(0)
selSet.Clear
FType(0) = 0: FData(0) = "POLYLINE"
FType(1) = 8: FData(1) = "Pline"
Call selSet.Select(acSelectionSetAll, , , FType, FData)
Set PLObject = selSet(0)
selSet.Clear
ReDim FType(2) As Integer
ReDim FData(2) As Variant
FType(0) = 0: FData(0) = "TEXT"
FType(1) = 1: FData(1) = "xy"
FType(2) = 8: FData(2) = "Text"
Call selSet.SelectByPolygon(acSelectionSetCrossingPolygon, PLObject.Coordinates, FType, FData)
Debug.Print ("Count: " + CStr(selSet.Count))
End Sub
Thanks!
szab0a