Add new Text Element to Map Document using arcpy

2036
3
08-16-2013 03:16 PM
Status: Implemented
Labels (1)
KirkHayer
Deactivated User

It would be useful to be able to programatically add new Text Elements to Map documents using arcpy.

Ex: For map templates, add Text Element with size of map, then Make Thumbnail, followed by deleting the newly createdText Element with map size and finally save the map.  This would allow users to see the map size on map templates similar to those that Esri provides.

3 Comments
DuncanHornby
I agree there should be some easier way of adding new TextElements but you can "add" new elements by cloning them. This relies on a text element existing in the layout which you clone from. Its a bit of a fudgeso it would much nicer to see some sort of method that allows you to add elements.

# Create a clone of all text elements and set the text to FRED
mxd = arcpy.mapping.MapDocument("CURRENT")
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
  x = elm.clone()
  x.text = "FRED"
JeffBarrette
Status changed to: In Product Plan

This will be available at Pro 3.2.  You will have the ability to create new Layouts and layout elements including text elements.  The function will be ArcGISProject.createTextElement().  Its on the ArcGISProject object because you can create text elements on a layout OR in a map's graphics layer.

 

Jeff - Layout and arcpy.mp teams

JeffBarrette
Status changed to: Implemented

This Idea has been implemented in ArcGIS Pro 3.2. Please see the What's New documentation for more new features in Pro 3.2.

The Your Ideas in ArcGIS Pro 3.2 blog and video have been posted to the Esri Community blog. You can take a look at these to see your idea and all others that were implemented in this release of ArcGIS Pro.

Jeff - Layout and arcpy.mp teams