I want to specify an input for each column of the 'field compare' parameter, so it would be 'baseFeatures' would link just to the 'Base Fields' column and 'updatedFeatures' would just link to the 'Updated Fields' column. This is basically what 'Compare Fields' do in the 'Detect Feature Changes' tool.
This is what I did.
class Tool(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Compare Features"
self.description = "Compare the features from two datasets (a base one and an updated one)" + \
"and returns the desired outputs."
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
baseFeatures = arcpy.Parameter(displayName="Input Base Features", name="base_Features", datatype="GPFeatureLayer", parameterType="Required", direction="Input")
updatedFeatures = arcpy.Parameter(displayName="Input Updated Features", name="updated_Features", datatype="GPFeatureLayer", parameterType="Required", direction="Input")
linearUnit = arcpy.Parameter(displayName="Search Distance", name="search_distance", datatype="GPLinearUnit", parameterType="Required", direction="Input")
fieldCompare = arcpy.Parameter(displayName="Compare Fields", name="compareFields", datatype="GPValueTable", parameterType="Optional", direction="Input")
paramNames = [baseFeatures.name, updatedFeatures.name]
fieldCompare.parameterDependencies = paramNames
fieldCompare.columns = [['Field', 'Base Fields'], ['Field', 'Updated Fields']]
geometryOutput = arcpy.Parameter(displayName="Geometry Changes Output", name="newandnochange_Features", datatype="GPBoolean", parameterType="Optional", direction="Input")
attributeChangeOutput = arcpy.Parameter(displayName="Attribute Changes Output", name="attributechanges_Features", datatype="GPBoolean", parameterType="Optional", direction="Input")
delAndNewOutput = arcpy.Parameter(displayName="Deleted/New Features", name="delandnew_Features", datatype="GPBoolean", parameterType="Optional", direction="Input")
params = [baseFeatures, updatedFeatures, linearUnit, fieldCompare, geometryOutput, attributeChangeOutput ,delAndNewOutput]
return params
I thought that with parameter dependencies I could specify two names, instead it only takes into account the first name I choose in the dependencies list (if Ihave 'baseFeatures.name' first both columns will only have the baseFeatures columns / if I have 'updatedFeatures.name' first it will only have the updatedFeature columns), and I can't "link" one parameter with the desired cloumn.
Does anyone know what am I missing?