How do I add multiple values with multiple filters to a python toolbox input?

477
0
05-16-2018 11:20 AM
ZackaryKing
New Contributor II

I am trying to create a python toolbox that allows the user to enter LiDAR surface constraints. The surface constraints input can consist of many feature classes with each feature class having a drop down list that lets the user select a field (z index/elevation) that is associated with the feature class and a second drop down that lets the user select the surface constraint type.

The getParameterInfo() code looks like this:

#Parameter to hold one or many surface constraints
param1 = arcpy.Parameter(
  displayName="LiDAR Surface Constraints",
  name="in_surfaceConstraints",
  datatype="GPValueTable",
  parameterType="Optional",
  direction="Input",
  multiValue=True
)

param1.columns = [['DEFeatureClass','Constraint Feature'],['GPString','Height Field'],['GPString','Constraint Type']]
param1.filters[1].list = ['<none>']
param1.filters[2].type = 'ValueList'
param1.filters[2].list = ['Anchor_Points', 'Hard_Line', 'Soft_Line', 'Hard_Erase', 'Soft_Erase', 'Hard_Replace', 'Soft_Replace', 'Hard_Clip', 'Soft_Clip']

 

In the updateParameters() class I think I need to update the param1.filters[1].list or add append a filter to each individual surface constraint feature class. The closest I have come so far is to append all the fields to one filter.

I have attached a screenshot of the toolbox input that is from the Create LAS Dataset that is native to ArcGIS for Desktop. I am trying to recreate a portion of that that will link up with the rest of my python script.

Example Toolbox Input

Hopefully that explains my predicament. 

Cheers,

Zack

0 Kudos
0 Replies