'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]))