Execute Built-In Command in ArcMap using Python Add-Ins Extension Event?

2196
3
02-12-2016 08:21 AM
JamesAnderson5
New Contributor

Hi ESRI Geonet,

The following is a re-post of my gis stack exchange question​ bearing the same title. Any help or suggestion here is greatly appreciated.

Is it possible to execute an ArcMap built-in command programmatically, using the Python Add-ins framework?

Can ArcMap built-in commands be exposed to and executed using the event methods found in the Python Add-ins Extension class? For example, I would like to open the attribute editing window upon triggering the onCreateFeature(self) method of my Extension class. Is it possible to automate window/menu opening using this approach?

Backstory: I am constructing a Python Add-in for ArcMap 10.3. According to this ESRI blog post, ArcMap’s built-in commands and tools (not referring to the geoprocessing tools, but to interactive tools like trace) can be added to Python Add-in toolbars, by referencing their respective GUIDs in the config.xml file associated with the Python Add-in project. Unfortunately from what I have found so far, tools/commands added this way do not appear to be exposed to the rest of the Python Add-ins framework at this time.

Am I approaching this problem the wrong way?

Thanks so much!

0 Kudos
3 Replies
JamesCrandall
MVP Frequent Contributor

Sounds more like a need to develop a .NET add-in rather than python.  In my experience, python is more useful/in-line with Geoprocessing than it is manipulating ArcObjects and other UI components to ArcGIS.

JamesAnderson5
New Contributor

Thanks James -

Unfortunately at the moment I have no exposure/skill in the .NET ecosystem, or any of its languages. I agree this type of requirement begs for a .NET approach, and someday soon I may need to just learn something solid about it.

This may be a bit esoteric or out-on-a-limb, but would you think something like Mark Cederholm's usage of comtypes could help solve this problem in a python-addins-only way? Jason Scheirer

0 Kudos
JamesCrandall
MVP Frequent Contributor

Unfortunately at the moment I have no exposure/skill in the .NET ecosystem, or any of its languages. I agree this type of requirement begs for a .NET approach, and someday soon I may need to just learn something solid about it.

All of the information required to learn it is out there.  For free.

0 Kudos