Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. import mygptool
  2.  
  3. class MyGPTool(object):
  4. def __init__(self):
  5. """Define the tool (tool name is the name of the class)."""
  6. self.label = "MyGPTool"
  7. self.description = "Does my stuff!"
  8.  
  9. def getParameterInfo(self):
  10. """Define parameter definitions"""
  11. return [arcpy.Parameter(displayName="State (Abbreviation)"
  12. ,name="state_abbreviation"
  13. ,datatype="GPString"
  14. ,parameterType="Required"
  15. ,direction="Input"
  16. )]
  17.  
  18. # Boilerplate isLicensed, updateParameters, updateMessages methods
  19.  
  20. def execute(self, parameters, messages):
  21. """The source code of the tool."""
  22. state_abbreviation = parameters[0].valueAsText
  23. mygptool.run_my_tool(state_abbreviation)
  24. return
  25.  
  26. arcpy.Parameter(displayName="My Database"
  27. ,name="smart_db"
  28. ,datatype="DEWorkspace"
  29. ,parameterType="Required"
  30. ,direction="Input"
  31. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement