I have a toolbar (in ArcGIS) set up with two buttons using python addin manager, can someone help me make sure this works, when I run these buttons nothing happens.
import arcpy
import pythonaddins
import os
class ButtonClass1(object):
"""Implementation for ReconTB_addin.button (Button)"""
def __init__(self):
self.enabled = True
self.checked = True
def onClick(self):
os.startfile('subprocess.py')
class ButtonClass2(object):
"""Implementation for ReconTB_addin.button_1 (Button)"""
def __init__(self):
self.enabled = True
self.checked = True
def onClick(self):
mxd = arcpy.mapping.MapDocument("Current")
df = arcpy.mapping.ListDataFrames(mxd)[0]
addLayer = arcpy.mapping.Layer(r"mypath/sample.shp")
arcpy.mapping.AddLayer(df, addLayer, "TOP")