Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Writing to Map Document Properties with Python

$
0
0
While working on some python scripts I quickly tried to erase the map title element via python using essentially the below code in a loop:

Code:

file = r"\\SUTCLIFFER-NEW\C$\Users\rsutcliffe\Desktop\Untitled.mxd"
mxd = arcpy.mapping.MapDocument(file)
mxd.title = ''
#Additional lines tried
mxd.save
del mxd

Doing this returns no errors but once I recheck the mxd the values are not removed. This happens on every mxd I've tried/created. It seems I'm having trouble writing to this property: mxd.title. Is anyone able to spot what I'm missing?

I noticed the following posts:

The first is about trouble writing to the map document properties in a "Save As":
http://forums.arcgis.com/threads/299...ht=title+write

The second is someone reportedly having success editing the property by running the code from within the mxd itself which I am also not able to do even though the code is pretty much the same.
http://forums.arcgis.com/threads/382...ht=title+write

any thoughts, advice are welcome. Thanks in advance.

Ryan Sutcliffe

Viewing all articles
Browse latest Browse all 2485

Trending Articles