MCederholm

10.1 beta and comtypes

Discussion created by MCederholm on Nov 10, 2011
Latest reply on Nov 11, 2011 by Dan_Patterson
I've been really busy this year and only just now started looking at the 10.1 beta.  I noticed that the current version of comtypes croaks when trying to wrap esriSystem.olb.  Fortunately, you can remedy this by adding the following entry to the _ctype_to_vartype dictionary in automation.py:

    POINTER(BSTR): VT_BYREF|VT_BSTR,

If there's a better approach I'd like to hear about it.


Also note that arcpy.da approaches ArcObjects via comtypes in terms of performance.  To query and hydrate ~500,000 polygons from a file GDB feature class:

ArcGIS 10.0SP3:
---------------
ArcObjects/comtypes: 31 sec
arcpy.SearchCursor: 96 sec

ArcGIS 10.1 Beta:
-----------------
ArcObjects/comtypes: 21 sec
arcpy.SearchCursor: 85 sec
arcpy.da.SearchCursor: 27 sec

Outcomes