ArcMap 10, ArcObjects, and Python:  very cool, but help with a couple of problems?

Discussion created by celticflute on Oct 26, 2010
Latest reply on Dec 9, 2010 by mahunter243
VITALS:  ArcGIS 10.0 - ArcView, Python 2.6.5, comtypes 0.6.2

I am writing an external Python script that needs to access the running ArcMap 10 application; therefore, I am getting my app reference through the AppROT object, which is working fine, as far as that goes.  So, here are my problems/questions:

1)  What object type is returned when I execute the line  pApp=pAppROT.Item(i)?  I definitely get an IApplication for ArcMap but on what object exactly?  I thought it was IApplication in the esriArcMapUI.olb, but that may not be the case ... esriFramework.olb maybe?  [BTW, pAppROT is the IAppROT interface on the AppROT object.]  It makes a difference, because I later QI to IMxDocument and get an error that the module (esriArcMapUI) has no attribute IMxDocument.  This may all relate to my 2nd question:

2)  I am building Python wrappers for ESRI olb's on the fly using the GetModule function in comtypes.  The problem is that wrappers are not being built for all of the olb's I specify, or rather the wrapper .py modules (the ones with the long GUID names) are empty.  esriFramework, esriGeometry, esriSystem, and esriSystemUI build just fine.  esriArcMapUI, esriCarto, and esriGeoDatabase do not build.  Has anyone else had this problem?  If so, how did you fix it ... if you did , that is?

Thank you all for the help.

-- Ti