I would like to create a button using Python Add-ins that allows the user to select a point on the map then immediately bring up a user prompt checkbox that was created in a separate toolbox. I thought what I wrote would work, but when I click on any point on the map, nothing happens. Is there something wrong with the way my script was written?
This is it:
import arcpy
import pythonaddins
arcpy.env.workspace = "E:/GIS/File_Organization/Data/Points/Points.gdb"
arcpy.env.overwriteOutput = True
class SelectWithinARadius(object):
"""Implementation for Button_from_Point_addin.SelectWithinARadius (Button)"""
def __init__(self):
self.enabled = True
self.shape = "NONE"
def onMouseDownMap(self, x, y, button, shift):
mxd = arcpy.mapping.MapDocument("CURRENT") #designate map document
pointGeom = arcpy.PointGeometry(arcpy.Point(x, y), mxd.activeDataFrame.spatialReference) #create point from lat/long
arcpy.MakeFeatureLayer_management(pointGeom, "point_lyr") #make feature layer from point
pythonaddins.GPToolDialog(r'E:\GIS\File_Organization\Data\Checkbox_Toolbox\Checkbox.tbx', 'Feature_Selection') #add selection toolbox for user input
arcpy.RefreshActiveView()
If not, was I not installing it correctly? I can also provide the code for the toolbox that I am trying to link through the GPToolDialog if that would help as well.