Python Map Document Dynamic Text

2162
8
10-28-2014 12:55 AM
PhilipHughes
New Contributor III

Hi

I have a large number of map documents that contain Dynamic Text,  These will not open with ArcGIS 10.2.2 and arcmap simply crashes.  I want to convert these text items to either graphics or ordinary text items.  I am struggling to locate the dynamic text items in the map document.  I can see them as "Dynamic Text" items in the layout window if I open the Map Document.

Can anyone advise how or what these Dynamic Text items appear in the mxd.  Have tried the below python but they do not display..

import arcpy
import arcpy.mapping as mapping
import commands

mxd = mapping.MapDocument("K:/7_users/Phil/mapdoc/test.mxd")

for elm in arcpy.mapping.ListLayoutElements(mxd, "text_element"):
    print elm.name, elm.text

Tags (1)
0 Kudos
8 Replies
Zeke
by
Regular Contributor III

I think if you converted them to graphics or ordinary text you'd lose the 'dynamic' aspect where they change based on the various criteria (page, date, etc.). Some, like title, don't need to be dynamic, so you may be able to use plain text for those.

I'm not sure ListLayoutElements considers dynamic text a retrievable element, but you might try leaving out "text_element" and just call it on the mxd, see if you get anything back. ESRI help doesn't mention whether dynamic text is returned or not, as far as I can tell. The best I can find is the statement 'Dynamic text is only supported for graphic text on the layout.' in the note on this page, which suggests it may be considered a graphical element. But I don't know for sure.

0 Kudos
BrandonKeinath1
Occasional Contributor III

Hi Philip,

Are you looking to convert the dynamic text to graphic for any other reason besides the mxd being unable to open?  From my experience the dynamic text shouldn't be causing the map not to open.  We use dynamic text elements as part of our map production process and it works fine.  I'll echo Greg Keith‌ that you should try removing the "text_element" from the ListLayoutElements.  That would help you see if it is finding anything.

Brandon

0 Kudos
PhilipHughes
New Contributor III

The mxds have been produced using arcmap 10.1 and the defense solutions.  They contain dynamic text that is causing them to crash arcmap 10.2.2 with defense solution 10.2.2. The dynamic text items are actually in the graphic element but I cannot find any documentation to find the methods or properties of the object that hold the text.  I wish to convert the dynamic text into a graphic and then the document will be openable.  The fact they no longer dynamic does not matter.  Each Mxd is an individual.

0 Kudos
Zeke
by
Regular Contributor III

So essentially you're saying you want to convert your dynamic text to Annotation, or something like that. Is that correct? I'm not sure this can be done, since only the TextElement class has a text property. Dynamic text is more like html than text.

As for Arc crashing, it may have something to do with the defense solution. Not familiar with that, but never had a problem with crashes in a regular Arc setup.

0 Kudos
PhilipHughes
New Contributor III

The dynamic text has been dropped by esri, I need to change the dynamic text into either a graphic or a text item with Python script if this is possible

Sent from my iPad

0 Kudos
BrandonKeinath1
Occasional Contributor III

Hi Philip,

I'm a little confused when you say ESRI has dropped support.  We're using dynamic text at 10.2.2 in our data driven page maps.  Is this something specific to your defense solution?  I didn't think that dynamic text was a different kind of element but a change to the content of the text element.  I think I have an idea about how to accomplish your workflow but want to make sure I'm understanding the problem before I give you an erroneous solution.

Thanks,


Brandon

0 Kudos
PhilipHughes
New Contributor III

HI

Just to clarify,  the elements in the layout are detailed as dynamic text, I believe they are MPS-Atlas Dynamic Text and this was depreciated at version 10.2.2

0 Kudos
BrandonKeinath1
Occasional Contributor III

Hi,

If that's the case then I don't know if there's much I can do to help.  I would contact support.esri.com and submit an incident.  They will be able to help you.  I've had good luck using support in the past.

Good luck,

Brandon

0 Kudos