Select to view content in your preferred language

Python Toolbox no parameters

05-01-2018 12:51 PM
Occasional Contributor

Hi All,

I've written a python script that I made into a tool, however I'd like to convert it over to a python toolbox for additional control of the tool interface. I'm fairly new to python and arcgis so I started by creating my tool parameters, and no matter what I try or how many times I check my syntax and other geonet threads I keep getting an error message that reads the tool has no parameters.

import arcpy

class Toolbox(object):
   def __init__(self):
      """Define the toolbox (the name of the toolbox is the name of the
      .pyt file)."""
      self.label = "Toolbox"
      self.alias = "Toolbox"

      # List of tool classes associated with this toolbox = [Tool]

class Tool(object):
   def __init__(self):
      """Define the tool (tool name is the name of the class)."""
      self.label = "ALCOSAN"
      self.description = ""
      self.canRunInBackground = False

def getParameterInfo(self):

   param0 = arcpy.Parameter(
      displayName="Output Features",

   param1 = arcpy.Parameter(
      displayName="Input Features",
      datatype= "GPValueTable",

   param1.columns = [["DEFeatureClass", "Input Layer"], ["GPDouble", "Relative Constraint"]]

   params = [param0, param1]

   return params

Tags (2)
0 Kudos
3 Replies
Occasional Contributor

Hi Grant, after making changes have you refreshed your toolbox's contents in ArcCatalog or the ArcMap Catalog window?  I copy/pasted your code and it worked right away:

Occasional Contributor

Yes, I refreshed it every time I made changes, but every time it said "no parameters"

Occasional Contributor

Yes, constantly, but it kept coming up with "no parameters" every time.

0 Kudos