Hi Jason,Sorry for the delay. I see in your code that you actually need a couple of extra steps. The IsPointIn method works on a polygon layer but you need to have a polygon feature selected to run the test, otherwise you need to loop through and test the rule against every polygon.In this instance I may have give you a bum steer as you are really need to use the GPS to find what is around you. In that case I would suggest you try the FindNearestXY method
//var objPoint = Map.Layers("Poles");
//var objPointRS = objPoint.Records;
//objPointRS.BookMark = Map.SelectionBookMark;
var objX = GPS.X; //objPointRS.Fields.Shape.X;
var objY = GPS.Y; //objPointRS.Fields.Shape.Y;
var objPoly= Map.Layers("Parcel");
var objPolyRS = objPoly.Records;
var objPolyBookMark = objPolyRS.FindNearestXY(objX,objY,0)
if (objPolyBookMark != 0)
{
//AddLayerFromFile routine
}
This way you will start at the GPS Position and find a polygon that is closest to it.I hope this helps. Let me know how you get on.Cheers,GarethP.S. Here is cbScript version for you.
'Dim objPoint
'Set objPoint = Map.Layers("Poles")
'Dim objPointRS
'Set objPointRS = objPoint.Records
'objPointRS.BookMark = Map.SelectionBookMark
Dim objX
objX = GPS.X 'objPointRS.Fields.Shape.X
Dim objY
objY = GPS.Y 'objPointRS.Fields.Shape.Y
Dim objPoly
Set objPoly = Map.Layers("Parcel")
Dim objPolyRS
Set objPolyRS = objPoly.Records
Dim objPolyBookMark
objPolyBookMark = objPolyRS.FindNearestXY(objX,objY,0)
if objPolyBookMark <> 0 then
Console.print objPolyBookMark
'AddLayerFromFile routine
end if