ArcPad and Python

As of ArcPad 10.0.3, the Windows (Desktop/Tablet) version
now supports the Python (2.6) scripting language in addition to vbScript and Jscript. There is a port of Python to windows Mobile, you might want to try PythonCE - http://sourceforge.net/projects/pythonce/
but do so at your own risk as it is not an "official" port.
- You can now write your applets and customizations in python and take advantage of many of the extra libraries that are available to Python users.
- Supports the ArcGIS implementation of ArcPy.
- If you have ArcGIS installed on the same PC as ArcPad they are already there, or
- Using ArcPad in conjunction with an ArcGIS Runtime license (I currently have this on my laptop).
It is important to note that this does not expose the ArcPad object model to be used in python scripts out side of ArcPad, in case you were thinking you could create ArcPad batch files.
There is an applet posted on the ArcPad Resources Site that covers the two scenarios mentioned above - ArcPad Python Applet
There are some subtle differences in writing for python with ArcPad:
- You must capitalize objects, methods and Events: Console.Print(Map.Layers.Count)
- You must use the full path to the message box: Application.MessageBox("ArcPad Rocks!")
- If you want to change the style of the message box you must use the index number of the MessageBox constant not the name: Application.MessageBox("ArcPad Rocks!", 0) instead of Application.MessageBox("ArcPad Rocks!", apOkOnly)
So now you have another scripting language choice moving forward when customizing ArcPad to fit your data collection/editing workflows.



News Feed (Atom)
3 Comments:
At Friday, January 06, 2012 8:49:00 AM,
Patrick said…
I'm very excited about the addition of Python to the coding possibilities in ArcPad. I'm relatively new to working with ArcPad Studio and need a little more help. I'm not sure where the Python syntax you use in your Python examples comes from. I've looked at this example and the GPS one in the gallery. But having a little 'ArcPad Python Quick Start' guide and tutorial (maybe in ArcPad's Help section) with examples and snippets would be greatly appreciated.
Thanks for the blog and for getting Python into Arcpad in the first place!
At Wednesday, January 11, 2012 3:57:00 PM,
Gareth Walters said…
Hi Patrick and sorry for the delay.
We are glad you are excited about the release of python support and are eager for more information. For now, I would suggest putting questions on the ArcPad Forum - http://forums.arcgis.com/forums/55-ArcPad for the most immediate help.
As all things time is limited and we have in our strategy to boost documentation for example scripts however it will just take some time.
So in the meantime keep posting on the forum where this is a huge user community to help out.
At Tuesday, January 31, 2012 2:04:00 AM,
Hq said…
Hi
Great !
Defining PYTHONPATH with ArcGIS "bin", "arcpy" and "bin" folder in Windows seems to be mandatory.
Sadly, the tools doesn' seem to work with AXF files (pb in "Input_Features" parameter in "MultipleRingBuffer_analysis" function)
Bye
HQ
Post a Comment
<< Home