Inserting new Text Element into MXD using ArcPy? [duplicate]

المشرف العام

Administrator
طاقم الإدارة
This question already has an answer here:


I'm using Desktop 10.2 and I tried with this script to add new text element "road 90" to a lot of mxd's, but Something wrong with the code:

import arcpyfrom arcpy import env env.workspace = r"F:\Projects\Nadav\road90\gis"for mxdname in arcpy.ListFiles("*.mxd"): print mxdname mxd = arcpy.mapping.MapDocument(r"F:\Projects\Nadav\road90\gis\\" + mxdname) for TextElement in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"): TextElementName = "road 90" if TextElementName == "TextElementName": true print 'text' mxd.save()del mxd

أكثر...
 
أعلى