0

Trying to create a map document programmatically. Added a featureclass as a layer. When I open the map document in ArcMap, I want the table for that layer to be open.

Found TableView (doc) and AddTableView (doc), but these seem to be only for standalone tables. I also looked at the properties for Layer (doc) and for DataFrame (doc) and didn't see methods that looked right.

What I'm shooting for is to double-click on the mxd and have something like image below appear.

enter image description here

Any ideas?

  • Are you saying that you want the map to be opened with the Table window already open with that table loaded? Or that you want the map to be opened with that table already added to the Table of Contents (and available in its List By Source view)? – PolyGeo Jan 25 '14 at 0:33
  • @PolyGeo I'm looking for the first of your two options. I added an image to make it clearer. Note that the table is associated with a layer/featureclass. – Roland Jan 25 '14 at 0:38
  • I cannot see you finding an ArcPy solution for this but if you are open (or closed) to ArcObjects then you should edit your Question to say that. – PolyGeo Jan 25 '14 at 0:43
  • rats. I'm open to it as long as I can code it in python. can I get at AOs? Kind of flirted w/it when messing around w/Geometry objects and the like. Haven't seen it w/GUI stuff. – Roland Jan 25 '14 at 0:52
  • 2
0

The limitation of ArcPy that you are encountering is best understood by reviewing the help page on Introduction to arcpy.mapping:

Arcpy.mapping is not a replacement for ArcObjects but rather an alternative for the different scenarios it supports. ArcObjects is still necessary for finer-grain development and application customization, whereas arcpy.mapping is intended for automating the contents of existing map documents and layer files.

The key words are:

ArcObjects is still necessary for ... application customization

because what you are trying to do is to customize the ArcMap application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.