SHARE
TWEET

Untitled

a guest Jun 17th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.                )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top