Hi,
I am trying to perform a trace operation by using the Trace tool in Utility Network toolbox and get a connectivity graph as result for ArcGIS 2.9 SDK. (here's my previous question on the same topic)
I am referring to the arcpy Python function (Trace (Utility Network)—ArcGIS Pro | Documentation) to view the list of parameters to use in the Geoprocessing.ExecuteToolAsync function. The code snippet is as follows:
var parameters = Geoprocessing.MakeValueArray(
"D:\\MyProject.gdb\\Communications",
"UPSTREAM", //trace type
"D:\\MyProject\\Default.gdb\\UN_Temp_Starting_Points", //starting points
null, //barriers
"Communications", //domain_network
"Cable", //tier
null, //target tier
null, //subnetwork name
null, //shortest_path_network_attribute_name
false, //"EXCLUDE_CONTAINERS",
false, //"EXCLUDE_CONTENT",
false, //"EXCLUDE_STRUCTURES",
true, //VALIDATE_CONSISTENCY
null, //condition_barriers
null, //function_barriers
"BOTH_JUNCTIONS_AND_EDGES",//traversability_scope
null, //filter_barriers
null, //filter_function_barriers
"BOTH_JUNCTIONS_AND_EDGES",//filter_scope
null,//filter_bitset_network_attribute_name
false,//filter_nearest
null, //nearest_count
null, //nearest_cost_network_attribute
null,//nearest_categories
null,//nearest_assets
null,//functions
null,//propagators
null,//output_assettypes
null,//output_conditions
false,//include_isolated_features
false,//ignore_barriers_at_starting_points
false,//include_up_to_first_spatial_container
"ELEMENTS CONNECTIVITY"//result_types
);
GPExecuteToolFlags executeFlags = GPExecuteToolFlags.AddOutputsToMap | GPExecuteToolFlags.GPThread | GPExecuteToolFlags.AddToHistory;
IGPResult result = await Geoprocessing.ExecuteToolAsync("un.Trace", parameters, null, null, null, executeFlags);
return result;
Here are my questions:
1. I want to pass only the following parameters to the GP trace tool: utility network, trace type, starting points, domain, tier and the result types. How can I set only these parameters and leave the rest to default? (This does not look possible since params args[] of MakeValueArray does not support named parameters)
2. If I have a list of Utility Network elements, how can I pass them to the starting points parameter of this function?