d484648

Trouble with lassBreakValues

Discussion created by d484648 on Jul 30, 2013
When I run the following script I get an error message.  I've checked and double checked that I'm referencing the files properly.

import arcpy
from arcpy import env
env.overwriteOutput = True
env.workspace = r"P:\planning\_Overview\arcmap"
df = arcpy.mapping.ListDataFrames(mapdoc, "layers")[0]  
lyr = arcpy.mapping.ListLayers(mapdoc, "Membership by ZIP Code", df)[0]
lyrFile = arcpy.mapping.Layer(r"P:\planning\_Overview\mapfiles\center_3.lyr")
arcpy.mapping.UpdateLayer(df, lyr, lyrFile, True)
lyr.symbology.classBreakValues = [1, 100, 250, 550]
lyr.symbology.classBreakLabels = ["1 - 100", "101 - 250", "251 - 550" ]
mapdoc.save
del mapdoc


Here's the error message:

  File "C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__
  File "P:\planning\_Overview\programming\test_sub_classbreakvalues_v1.py", line 9, in <module>
    lyr.symbology.classBreakValues = [1, 100, 250, 550]
  File "C:\Program Files\ArcGIS\Desktop10.1\arcpy\arcpy\arcobjects\_base.py", line 87, in _set
    return setattr(self._arc_object, attr_name, cval(val))
RuntimeError


What am I doing wrong?  Thanks for your help.

Outcomes