How to auto populate x y coordinates into an ArcPAd form

4400
4
08-16-2011 11:18 AM
AustenCutrell
New Contributor
Does anyone know how to auto populate x y coordinates into an ArcPad form? I have no expireience in VB scripting, however I have made several basic ArcPad forms. I would like to learn if this capability is possible and how to execute it.
Tags (3)
0 Kudos
4 Replies
LastingerBrooks
New Contributor III
Your value is going to be the following:

Application.GPS.X
Application.GPS.Y

As in: msgbox ("My X Coordinate for the GPS is: " & Application.GPS.X)

The coordinates should return in whatever your coordinate system is for the map doc you're in.



If you want to load this, write a simple subroutine into your VBScript file:

'Sets the editboxes named 'txtXCoordinate' and 'txtYCoordinate to their X and Y Coordinates respectively

Sub OnOpenForm

txtXCoordinate = Application.GPS.X
txtYCoordinate = Application.GPS.Y

End Sub

Now, all you have to do is Set your Form's "OnLoad" object to "OnOpenForm," and Presto,

COORDINATES!
0 Kudos
stuartcassin
New Contributor III
This looks exactly like the thing I need to execute the same function. Like Geogeek, my VB skills are extremely limited so I'm not sure how to get this into a .apl. I've had few trys at it and it's not coming together (ran it in ArcPad a few times with no result) so I'm obviously missing a step or two.

Can anyone give me a step by step, talk to me like I'm a 5 yr old, method of writing this script into a form please??
0 Kudos
DeniseKing
Esri Regular Contributor
One of the easiest methods I have used is the 'Add XYZ to Table' applet found on Esri ArcScripts site,
http://arcscripts.esri.com/details.asp?dbid=16785. This Applet automatically adds GPS information to the attribute table  when a feature is created or modified, if the table contains specific  fields.

Cheers,
Denise
0 Kudos
stuartcassin
New Contributor III
Cheers Denise,

It looks like a good option but I need to populate the form as it opens so the field staff can visully confirm the location has been captured and potentially compare the captured XY coordinates with previous coordinate readings.

So I need to auto populate the X and Y fields with the readings from the GPS device. If anyone can step-by-step detail how I go about achieving this, I'll be enternally grateful.
0 Kudos