Another thing for incrementing the value for crossing window like Keith mentioned you could
replace
Dim psr As PromptSelectionResult = ed.SelectCrossingWindow(getPnt, New Point3d(getPnt.X + 3, getPnt.Y, 0))
If psr.Value.Count = 0 Then
Exit Sub
End If
with
Dim increment As Vector3d = New Vector3d(0.5, 0, 0)
Dim otherPnt As Point3d = getPnt.Add(increment)
Dim counter As Integer = 0
Dim psr As PromptSelectionResult = ed.SelectCrossingWindow(getPnt, otherPnt)
While psr.Status <> PromptStatus.OK OrElse psr.Value.Count < 1
If HostApplicationServices.Current.UserBreak OrElse counter = 100 Then
Exit Sub
End If
otherPnt = otherPnt.Add(increment)
psr = ed.SelectCrossingWindow(getPnt, otherPnt)
counter += 1
End While
The counter is for ending while loop in case user selects a point that will not end up selecting any objects
The UserBreak is for ending loop so you will not get stuck in loop if they press escape
It just uses a Vector3d as a incrementing value and keeps adding to the point to increment the window 0.5 units.
Dim poly As Polyline = trx.GetObject(entId, OpenMode.ForRead)
Dim tempExtents As Extents3d
Dim polyExtents As Extents3d = poly.GeometricExtents
polyExtents.TransformBy(bref.BlockTransform)
tempExtents = polyExtents
tempExtents.AddPoint(getPnt)
If polyExtents.IsEqualTo(tempExtents) Then
poly.UpgradeOpen()
poly.Color = Color.FromColorIndex(ColorMethod.ByAci, 1)
End If
In case you have not figured it out
Once the crossing window selects a object it checks if it is a Blockreference and if it is it gets the BlockTableRecord and loops through it and checks for polylines
then get the polylines Extents.
Then it takes those extents and uses the Extents3d.TransformBy(BlockReference.BlockTransform) to transform it to the BlockReference insertion.
Then assigns a temp extents to same value as transformed extents and adds a point to to temp extents with Extents3d.AddPoint(SelectedPoint)
if that point is inside the extents then polyExtents.IsEqualTo(tempExtents) will be true.
Again there is probably a better way of figuring out if it falls inside a rectangle