I'm trying to create a button that sets the map scale to 24000. I'm working in ArcMap 10.1 and my Python programming skill is rudimentary.
I followed the Python Add-In instructions and the creation was successful - I have a new toolbar and a new button - but nothing happens when I click the button. Here's the code:
import arcpy import pythonaddins class ButtonClass13(object): """Implementation for ScaleBtn_addin.Scale24 (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): mxd = arcpy.mapping.MapDocument('current') df = arcpy.mapping.ListDataFrames(mxd) df.scale = 24000