Hey Guys!I got this here 100 foot rectangle, that I have centered around my GPS position.(Actually it's more of a volume- I added floor and ceiling values of one jillion just to be sure Z values weren't messing this up)I also have this point layer: "JC_Signs." that contains point objects I want to select from.So whenever this command fires, what it should do, is search this 100 foot rectangle for the nearest point in JC_Signs, and pop up a message box that contains the OBJECTID of that nearest point to my GPS position, along with a nice purple box around my GPS position that represents the searched range.All I got returning right now is zeroes.Is there anyone out there who can show me the light of a working FindNearestXY method?
'RangeRectangle
'This creates a my 100 foot rectangle around my position.
dim Rectangle100ft
Set Rectangle100ft = Application.CreateAppObject("rectangle")
Rectangle100ft.Left = Application.GPS.X - 100
Rectangle100ft.Right = Application.GPS.X + 100
Rectangle100ft.Top = Application.GPS.Y + 100
Rectangle100ft.Bottom = Application.GPS.Y - 100
Rectangle100ft.Floor = Application.GPS.Z - 1000000000000
Rectangle100ft.Ceiling = Application.GPS.Z + 1000000000000
'Rectangle Symbology
'This creates symbology to symbolize my rectangle.
Dim pSymbol
Set pSymbol = Application.CreateAppObject("Symbol")
pSymbol.LineColor = 8388736
pSymbol.LineWidth = 4
pSymbol.BackgroundMode = 1
psymbol.FillStyle = 1
'Recordset Gathering
'This grabs the recordset
Dim objRecordSet
Set objRecordSet = Layers("JC_Signs").Records
Dim ObjRecordSetFields
Set ObjRecordSetFields = ObjRecordSet.Fields
'This draws the RangeRectangle
Call Map.DrawShape (Rectangle100ft, pSymbol)
'This pops up the message box with the nearest Object ID from "JC_Signs"
msgbox (ObjRecordSet.FindNearestXY( Application.GPS.X, Application.GPS.Y ,1000000 , [Rectangle100ft]))