Inserting newlines in Rectangle Text elements via ArcPy causes overlap?
I ran into this as well. It's because ArcGIS requires Windows line endings which are both a carriage return and a line feed. Bit of a pain. Fortunately it's easy to get around. In Python by instead of just \n
(which is linefeed - see the Python docs for more if you're keen), use \r\n
.
I think it is easier to use the textwrap module:
Python label expression:
def FindLabel ( [LEGAL1] ):
import textwrap
return '\r\n'.join(textwrap.wrap([LEGAL1], 20)) #charcter width set at 20
And the resulting labels have carriage returns split at whatever character width you chose.