Last active
March 10, 2025 15:06
-
-
Save knu2xs/0bcc4bc5b9bf95751131 to your computer and use it in GitHub Desktop.
Toolbox in ArcGIS Python Add-In
This file contains hidden or 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
| import arcpy | |
| import pythonaddins | |
| class addDefinitionQueryLayers(object): | |
| """Implementation for arcpyMappingAddin_addin.button (Button)""" | |
| def __init__(self): | |
| self.enabled = True | |
| self.checked = False | |
| def onClick(self): | |
| pass |
This file contains hidden or 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
| import arcpy | |
| import pythonaddins | |
| import os.path | |
| class addDefinitionQueryLayers(object): | |
| """Implementation for arcpyMappingAddin_addin.button (Button)""" | |
| def __init__(self): | |
| self.enabled = True | |
| self.checked = False | |
| 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