Select to view content in your preferred language

Python Toolbox - populate drop down from layers loaded in the contents for each parameter

149
1
Jump to solution
12-11-2024 09:49 AM
HeatherDulaney1
Emerging Contributor

Hi All,

I can't seem to find any information on populating a drop down for each parameter that is already in my contents in ArcPro. Any idea on how to do so? For whatever reason it does it for my Study Area parameter but not the others. See the Study Area Parameter for what I am looking for in the image attached.

Anyone have any suggestions? 

Thanks, Heather

Here is my code for the parameters (if this helps): 

def getParameterInfo(self):

#Define the parameters
Extent = arcpy.Parameter(
displayName = "Define Extent",
name = "Extent",
datatype = "GPExtent",
parameterType = "Required",
direction = "Input")

Identify_Workspace = arcpy.Parameter(
displayName = "Identify Workspace",
name = "Identify_Workspace",
datatype = "DEWorkspace",
parameterType = "Required",
direction = "Input")

Study_Area = arcpy.Parameter(
displayName="Study Area",
name="Study_Area",
datatype="GPFeatureLayer",
parameterType="Required",
direction="Input")
Study_Area.controlCLSID = "{60061247-BCA8-473E-A7AF-A2026DDE1C2D}"

Base_Raster = arcpy.Parameter(
displayName="Base Tree Raster (such as tree height, canopy cover percentage, etc.)",
name="Base_Raster",
datatype="DERasterDataset",
parameterType="Required",
direction="Input")

#Base_Raster.filter.type = "ValueList"

dBASE_file = arcpy.Parameter(
displayName = "Class Ranges (dBASE file)",
name = "dBASE_file",
datatype = "DEDbaseTable",
parameterType = "Required",
direction = "Input")

parameters = [Extent, Identify_Workspace, Study_Area, Base_Raster, dBASE_file]
return parameters

0 Kudos
1 Solution

Accepted Solutions
AlfredBaldenweck
MVP Regular Contributor

Try Raster Layer  and Table View data types.

View solution in original post

1 Reply
AlfredBaldenweck
MVP Regular Contributor

Try Raster Layer  and Table View data types.