ArcObjects in Python

08-31-2014 04:45 PM
MVP Honored Contributor

I recently had to venture outside Arcpy functionality by adding guides to a map document, finally achieved by using the comtypes library (downloaded from Sourceforge here). I followed the instructions from a 2010 presentation by Mark Cederholm (here).

I'm curious, is this the current way to incorporate fine-scale (i.e. ArcObjects) control through Python?

0 Kudos
3 Replies
MVP Esteemed Contributor

Wow, thanks for sharing that.

I read Mark's C's slides - and  it seems to me it's so much trouble and the performance is so poor that I wonder whether it's worth the effort. I really doubt Esri would support this if you ran into any trouble, too.  I have to wonder, if you really have a need for ArcObjects (I know this is blasphemy, but) perhaps Python is simply not the right tool for the job.

MVP Honored Contributor

If you are starting a new project and are proficient in ArcObjects, then, agreed, pure ArcObjects would be better.

For me, it was worth the effort to figure it out, since I had a functional Python script that needed one small piece of added interaction that Arcpy could not afford (particularly, adding guides to the map).

Regular Contributor

I think you're right on with that assessment, Darren. I recently deployed some ArcObjects functionality to do some change detection on our enterprise datasets, specifically so that I could return the date modified of a file geodatabase feature class: Programmatically return Feature Class file size and date modified

I'll continue to access bits of ArcObjects functionality through Python because I like Python and it makes sense to me. At the same time, I'll hold on to the hope that Esri will continue to expand the reach of arcpy so that these trickier customizations become part of the default site package in the future.