ESRI’s ArcPy… A VBAish Replacement? Maybe…

I haven’t done much, actually nothing, in the way of development over the last year at SRK.  Last week at the ESRI UC there was an awful lot of talk about Python, and ArcPy.  I didn’t actually attend any ArcPy sessions, other than watching a bit of one demo in the showcase area.  However, one of my colleagues did take in an ArcPy session and was quite excited about, and what it has to offer.

I have done a considerable amount a VBA in the Autodesk products, and moved onto the .NET world when VBA was deprecated.  I do not consider my self a ‘heads-down’ developer, but more of a hacker/compiler/scripter, and I was not one of those people that could not leave VBA behind and complained to anyone who would listen that ESRI, Autodesk, <insert any company name licensing VBA), and Microsoft were pure evil for moving on from VBA.  There are a MANY reasons why it was time to move, the biggest being 64bit, but I’m not getting into that here.

Where am I going with this you ask?

Well, my first real exposure to Python + ArcPy this morning has me quite excited.  WRT to ESRI products at least, this is, and should be, a very viable replacement for VBA scripting.  As I was perusing the ArcPy help I saw a sample on how to Export a Map to PDF.  “Wow!” I thought, “this could save me A LOT of time if I could script it to process all MXDs in a given folder”  So, off I went and within an hour I had the script created and a GP Tool Dialog to allow the user to select the folder to process and generate PDFs for all of the MXDs in the selected folder.  I have to re-iterate, I had not touched or used Python or ArcPy previous to this endeavour.  It is a very easy to read and use scripting language that I can see a TON of use for.  I will be continuing to look for ways to automate processes via ArcPy.
The Python command line in the ArcGIS Products has Intellisense built-in, and anybody with VBA experience would catch on to the syntax in no time at all.

Comments

Popular posts from this blog

ArcGIS: Packaging error - General function failure

More ArcGIS Woes with 'Special' Characters...

ArcGIS Collector: Update Error Code 1006