Hello all:
I'm posting in follow up to Steven Porter's post about Process Arcpad Project with Selection Changes.
We are trying to programmatically automate my organization's check-in / check-out procedure. To do this, we save an .MXD, use the Configure Project for Geoprocessing tool on the ArcPad Data Manager toolbar to create the .APO file, then run the Process ArcPad Project geoprocessing tool using Python.
So I select a subset of data in my .mxd, then I run the Configure Project for Geoprocessing tool in the toolbar, being sure to associate our custom .APL's to editable layers and checking out non-edit layers as read only shapefiles (per best practices).
I set my output location, choose to create an .apm, and I also make sure to select "The extent of the currently selected feature(s)" because that's all I want - data for a subset of counties. click finish and it tells me its ready for geoprocessing. Great. I save and exit.
Now I want to test and see what the tool returns by calling arcpy.ProcessArcPadProject_ArcPad in IDLE, passing it the full path of the name of the .mxd I just saved. The tool runs, and it works without a hitch. However, I open up the resultant project in ArcPad, and it's the entire state - not my selected subset.
Why is this? I selected it to subset to "The extent of the currently selected feature(s)", yet it did not. To confirm that I told the tool to only give me the extent of the currently selected features, I opened the .APO file in notepad (I did not edit it). Within the PARAMETERS tag, the value spatialextent="2", which by referencing esriAPToolsSpatialExtentOption in the ArcPad Data Manager Object Model, value 2 is for esriAPToolsExportCurrentSelectionExtent- extent of the the currently selected features; yet it is returning everything.
Further, if I then open the .mxd, and manually click through the Get Data for Arcpad tool, leaving all other settings as they were, it properly sub-sets the data based on the selected counties. What gives?
Anyone have an explanation? A work around? Is there a way to call the Get Data From ArcPad tool from Python? If I definition query my selected counties, could I spatial query all my other layers in the TOC based on the Counties layer? (Data Sources are from SDE hosted in SQL server) Why is the Process ArcPad Project geoprocessing tool not returning me the proper extent when it is called though Python? Help is greatly appreciated!
Matt