jenabbott

Text Element Automation-Cannot access Property Number from attribute table

Discussion created by jenabbott on Oct 16, 2013
Latest reply on Oct 16, 2013 by jenabbott
Good morning,

I am using ArcMAP 10.1 and I am trying to automate the text elements of my map using python and I am stuck as I cannot figure out how to access the Property number from the attribute table.

I have gotten this far;

>>>import arcpy
>>>mxd=arcpy.mapping.MapDocument("CURRENT")
>>>elemlist=arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT",'Sub Title')
>>>whereClause="ELEMLIST = " + str(elemlist)
>>>lyr='300105'
>>>cursor=arcpy.da.SearchCursor("300105","PROPERTY",whereClause)
>>>lyrRow=cursor.next
>>>elemlist.text=str(lyr.Row.getValue("PROPERTY"))

Everything up to the last line works. An error comes up saying "'str' object has no attribute 'Row'". So I tried this code;

>>>elemlist.text=str(lyrRow.getValue("PROPERTY"))

This code comes up with an error that says "'method-wrapper' object has no attribute 'getValue'".

Can someone please help me???

Outcomes