Last active
August 29, 2015 13:56
-
-
Save knu2xs/8955815 to your computer and use it in GitHub Desktop.
Example onclick event to streamline the process of including a toolbox and tool as part of a Python add-in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def onClick(self): | |
# name of toolbox without tbx extension | |
toolboxName = "Mapping" | |
# name of tool to be executed | |
toolName = "AddDefinitionQueryLayers" | |
# create string with path to toolbox | |
toolboxPath = os.path.join(os.path.dirname(__file__), toolboxName + ".tbx") | |
# call geoprocessing tool | |
pythonaddins.GPToolDialog(toolboxPath, toolName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment