Wednesday, 21 March 2018

arcgis 10.1 - Adding Table to Layout View using ArcPy?


I am using ArcGIS 10.1 and I have a non-spatial table and some layers in a Data Frame.


When I switch to Layout View I want to be able to show the map in a data frame element and the table in another element (something that one could do with "Add Table To Layout" from Table Options, but I want to do this in one step without having to go to Table Options).


Is there a way to do this using ArcPy?


I couldn't find any function in the ArcPy library that would create a new Layout Element ... and then I also don't know how to add the contents of the table to the Layout Element.



Answer



It is not possible to create a new Layout Element from scratch using ArcPy but since ArcGIS 10.1 you have been able to clone graphic and text elements.


In the GraphicElement (arcpy.mapping) help there is code that shows you how to use cloning to:



construct a graphic table based on data values from a table in the map document.




If you are not keen on using ArcPy to do this then there are a number of ArcGIS Ideas to which I recommend that you add your vote:



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...