Dear GeoNet
Is there a way to retrieve the return value of a geoprocessor by the name of the value?
Currently I am using the call:
IGeoProcessorResult geoProcessorResult = gp.Execute(toolName, parameters, null);
I am able to retrieve the geoprocessor results from the array geoProcessorResult with:
IGPValue myValue = geoProcessorResult.GetOutput(i);
But I would like to retrieve the result with the name of the parameter instead with the index.
Looking forward to any suggestions.
Best regards,
Yvo
Solved! Go to Solution.
I don't think we provide any other mechanism to retrieve the output other than using the int for the index. If you wanted you could list the parameters for the tool and create a dictionary or similar construct that collects the name of the output parameter and it's position in regards to only the parameters with an output direction. You could provide the name of the parameter to the dictionary and it would then substitute the int index for you.
IGPToolbox Interface
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002n000003s4000000
IGPTool Interface
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002n000003s3000000
I don't think we provide any other mechanism to retrieve the output other than using the int for the index. If you wanted you could list the parameters for the tool and create a dictionary or similar construct that collects the name of the output parameter and it's position in regards to only the parameters with an output direction. You could provide the name of the parameter to the dictionary and it would then substitute the int index for you.
IGPToolbox Interface
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002n000003s4000000
IGPTool Interface
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002n000003s3000000