The ArcPad Team Blog

Unofficial stuff from the team behind the World's leading mobile GIS platform

Friday, August 22, 2008

Using a ToolBox Model to create a customised ArcPad Check Out (PART 2)

In one of my previous posts

I descibed how to use model builder to automate your check out in ArcPad 7.1. I also eluded to (at the end of the help document) the fact you can add a step to deploy your files to your mobile device.

To do this you will need to download Microsofts CECopy tool which is a part of the Windows Mobile Developer Power Toys:

To add this to your model, you will need to create a script file which invokes the application, and add this as a 'script' tool to your toolbox (mine's called CECopy, see below)

The content of the file CECopy.vbs that this refers to looks like this:

dim WshShell
Source_FileSpec = wscript.arguments.item(0)

Destination = wscript.arguments.item(1)

a = "C:\Program Files\ArcPad 7.1\Desktop Tools\Samples\AXFCopy\CECopy.exe"
b = Source_FileSpec
c = Destination
d = chr(34) & a & chr(34) & chr(32) & chr(34) & b & chr(34) & chr(32) & c

Set WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run(d)

Before the script tool can be used in toolbox, parameters need to be defined in the tool (in addition to being defined in the script) - this will allow you to interactively chose the input files, either in an edit box (if you run it standalone) or as the output from another tool. Right mouse click on the script in ArcCatalog and choose 'properties'. you will need to define two input parameters and ensure that their data type matches what you are actually moving (ie: if you use this in a model and your output from a previous step is a file - then the data type for source_filespec must be 'file').

You should now be able to create a model that looks something like this:

Which will perform a 'fresh' check out of the Riverside sample data (gdb), copy the layer definitions from the sample Riverside AXF (ie: custom forms), and copy the resultant AXF to a connected windows mobile device.

NB: Two new toolbox tools have been designed for ArcPad 7.2 which will eliminate the need for the scripting shown here. 'ArcPad Saved Check Out' will allow to repeat a check out previously configured in ArcMap, and 'Arcpad Deployment' will allow you to deploy data to your device. To try these new tools, sign up for the ArcPad 7.2 beta program.