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

inserting text in map layout

$
0
0
Hi Guys,

I was wondering if it is possible to insert all possible values of a loop into map layout as a text element. The script I have prints only one value or line. Here is part of my code. Thanks for your help !!

Daniel A.

Code:

arcpy.AddMessage('Adding Text Elements...')

arcpy.AddMessage('*************************')

# search input feature
rows=arcpy.SearchCursor(inputFc)

# Retrieve the first record from the list
row=rows.next()

# set field value list
FieldValList = []

# loop through the field ATS
while row:
      feat=row.shape     
      total=total+feat.area
      ATS = row.getValue("ATS") 
   
           

      # make sure its unique
      if not ATS in FieldValList:
                    FieldValList.append(ATS)               
                     
                                   
                               
           
      # next field
      row=rows.next()       
             
                   
               

      # add text elemets to the map layout
      for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
          if elm.name == "ATSList":

              elm.elementPositionX = 6.5
              elm.elementPositionY = 1.0

              for ATS in FieldValList:
         
                  elm.text = "Within Theoretical: " + "\n" + ATS


Viewing all articles
Browse latest Browse all 2485

Trending Articles