Hi.
I have two python toolboxes (.pyt scripts) working in arcmap (10.1 SP1). One of them can show loaded arcmap layers (as the displayable triangle icon on the right) in its main input field, but the other one doesn't, despite they share most of the python code.
Maybe I'm missing some basic environment setting...
Any help would be really appreciated.
Regards,
John
script excerpt:
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "MyLabel"
self.description = "Calculates parameters of a raster."
self.canRunInBackground = True
def getParameterInfo(self):
"""Define parameter definitions"""
# Input raster DEM parameter
in_raster = arcpy.Parameter(
displayName="Input Raster",
name="in_raster",
datatype="DERasterDataset",
parameterType="Required",
direction="Input")
....
def execute(self, parameters, messages):
"""The source code of the tool."""
arcpy.env.overwriteOutput = True
...
I have two python toolboxes (.pyt scripts) working in arcmap (10.1 SP1). One of them can show loaded arcmap layers (as the displayable triangle icon on the right) in its main input field, but the other one doesn't, despite they share most of the python code.
Maybe I'm missing some basic environment setting...
Any help would be really appreciated.
Regards,
John
script excerpt:
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "MyLabel"
self.description = "Calculates parameters of a raster."
self.canRunInBackground = True
def getParameterInfo(self):
"""Define parameter definitions"""
# Input raster DEM parameter
in_raster = arcpy.Parameter(
displayName="Input Raster",
name="in_raster",
datatype="DERasterDataset",
parameterType="Required",
direction="Input")
....
def execute(self, parameters, messages):
"""The source code of the tool."""
arcpy.env.overwriteOutput = True
...