Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question already has an answer here:

I want to update a Text_Element with a newline or page break using ArcGIS Desktop 10.0.

Does anyone know the tag or syntax?

share|improve this question

marked as duplicate by PolyGeo, Jason Scheirer, Devdatta Tengshe, Curlew, Paul Jul 8 at 12:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers 2

up vote 3 down vote accepted

The second example in the online help demonstrates how to add the newline to a text element.

share|improve this answer
    
Thanks Dan. I was trying /n and <br/> and all that stuff. Your suggestion worked. –  Justin Feb 23 '12 at 15:44
add comment

Dan is correct (and answered before me), but I had to try this myself, as I assumed that there was no way that a \n would work (that would be too easy!)

I made a textbox, named it "Text", added some text:

enter image description here

Ran this code that Dan points to:

>>> import arcpy
>>> mxd = arcpy.mapping.MapDocument("CURRENT")
>>> elm = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "Text")[0]
>>> elm.text = 'Date: <dyn type="date" format="short"/> \nTime: <dyn type="time" format=""/>'
>>> arcpy.RefreshActiveView()

And got this:

enter image description here

Also, this seems to only work programmatically; adding a \n in the textbox in ArcMap only outputs the \n as text.

share|improve this answer
3  
You should use \r\n instead of just \n, otherwise it can cause TextElements to bug out. See this question I asked a few months ago. –  dmahr Feb 23 '12 at 15:28
1  
@dmahr - Interesting, thanks for pointing that out. –  Chad Cooper Feb 23 '12 at 15:32
add comment

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