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?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
The second example in the online help demonstrates how to add the newline to a text element.
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:
Ran this code that Dan points to:
>>> import arcpy >>> mxd = arcpy.mapping.MapDocument("CURRENT") >>> elm = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "Text") >>> elm.text = 'Date: <dyn type="date" format="short"/> \nTime: <dyn type="time" format=""/>' >>> arcpy.RefreshActiveView()
And got this:
Also, this seems to only work programmatically; adding a
\n in the textbox in ArcMap only outputs the \n as text.