VB SelectByPolygon
Hi,
I want to find the Texts inside a polygon within a VB program. To do this I use the funcion SelectByPolygon but it does not work, I use it giving the array of points of the polygon and it does not return any objects in the selection.
Any clues? Is there an alternative?
Thank you
Guillerme.
Comments
-
Sub Test_SelectByPolygon()
Dim PtList(0 To 11) As Double
PtList(0) = 95.7475: PtList(1) = 95.7475: PtList(2) = 0
PtList(3) = 125.384: PtList(4) = 196.021: PtList(5) = 0
PtList(6) = 211.946: PtList(7) = 158.689: PtList(8) = 0
PtList(9) = 189.508: PtList(10) = 74.9487: PtList(11) = 0
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.ActiveSelectionSet
Call ss.SelectByPolygon(acSelectionSetWindowPolygon, PtList)
ss.Highlight True
MsgBox "ss contains " & ss.Count & " entities"
ss.Highlight False
End Sub0 -
Thank you Ferdinand for your quick answer.
The function worked properly, my problem was that my drawing had a UCS coordinates. The coordinates that define my selection polygon come from an existing polyline, when I retrieve the points from the polyline I get WCS coordinates and I used this to define the polygon on the function and this function expects UCS coordinates so the polygon was in other area.
Thank you
Guillerme.
0