<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Utility network trace using geoprocessing tool in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1146345#M7817</link>
    <description>&lt;P&gt;Hi KarthikAditya,&lt;/P&gt;&lt;P&gt;For the required parameters, you cannot set it to default, but for the optional parameters, you can just put "" to keep it empty and set it as default. I would recommend returning your parameters in a block and then using the parameter variable in your ExecuteToolAsync() method to make your code cleaner and easier to read.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var ParameterArray = await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;/{&lt;/P&gt;&lt;P&gt;return Geoprocessing.MakeValueArray("&lt;SPAN&gt;un.Trace", parameters, "", "", ""&lt;/SPAN&gt;);&lt;BR /&gt;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IGPResult result = await Geoprocessing.ExecuteToolAsync("geoprocessing tool you want to use here(e.g. management.SelectLayerByLocation)",ParameterArray);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope that helps.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 04:49:52 GMT</pubDate>
    <dc:creator>ThiPham12</dc:creator>
    <dc:date>2022-02-22T04:49:52Z</dc:date>
    <item>
      <title>Utility network trace using geoprocessing tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1146095#M7811</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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. (&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-tracing-results-as-connectivity-graph/m-p/1145115#M7796" target="_self"&gt;here's my previous question on the same topic&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;I am referring to the arcpy Python function (&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/trace.htm" target="_blank"&gt;Trace (Utility Network)—ArcGIS Pro | Documentation&lt;/A&gt;) to view the list of parameters to use in the Geoprocessing.ExecuteToolAsync function. The code snippet is as follows:&lt;/P&gt;&lt;P&gt;var parameters = Geoprocessing.MakeValueArray(&lt;BR /&gt;"D:\\MyProject.gdb\\Communications",&lt;BR /&gt;"UPSTREAM", //trace type&lt;BR /&gt;"D:\\MyProject\\Default.gdb\\UN_Temp_Starting_Points", //starting points&lt;BR /&gt;null, //barriers&lt;BR /&gt;"Communications", //domain_network&lt;BR /&gt;"Cable", //tier&lt;BR /&gt;null, //target tier&lt;BR /&gt;null, //subnetwork name&lt;BR /&gt;null, //shortest_path_network_attribute_name&lt;BR /&gt;false, //"EXCLUDE_CONTAINERS",&lt;BR /&gt;false, //"EXCLUDE_CONTENT",&lt;BR /&gt;false, //"EXCLUDE_STRUCTURES",&lt;BR /&gt;true, //VALIDATE_CONSISTENCY&lt;BR /&gt;null, //condition_barriers&lt;BR /&gt;null, //function_barriers&lt;BR /&gt;"BOTH_JUNCTIONS_AND_EDGES",//traversability_scope&lt;BR /&gt;null, //filter_barriers&lt;BR /&gt;null, //filter_function_barriers&lt;BR /&gt;"BOTH_JUNCTIONS_AND_EDGES",//filter_scope&lt;BR /&gt;null,//filter_bitset_network_attribute_name&lt;BR /&gt;false,//filter_nearest&lt;BR /&gt;null, //nearest_count&lt;BR /&gt;null, //nearest_cost_network_attribute&lt;BR /&gt;null,//nearest_categories&lt;BR /&gt;null,//nearest_assets&lt;BR /&gt;null,//functions&lt;BR /&gt;null,//propagators&lt;BR /&gt;null,//output_assettypes&lt;BR /&gt;null,//output_conditions&lt;BR /&gt;false,//include_isolated_features&lt;BR /&gt;false,//ignore_barriers_at_starting_points&lt;BR /&gt;false,//include_up_to_first_spatial_container&lt;BR /&gt;"ELEMENTS CONNECTIVITY"//result_types&lt;BR /&gt;);&lt;BR /&gt;GPExecuteToolFlags executeFlags = GPExecuteToolFlags.AddOutputsToMap | GPExecuteToolFlags.GPThread | GPExecuteToolFlags.AddToHistory;&lt;/P&gt;&lt;P&gt;IGPResult result = await Geoprocessing.ExecuteToolAsync("un.Trace", parameters, null, null, null, executeFlags);&lt;BR /&gt;return result;&lt;/P&gt;&lt;P&gt;Here are my questions:&lt;/P&gt;&lt;P&gt;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&amp;nbsp;MakeValueArray does not support named parameters)&lt;/P&gt;&lt;P&gt;2. If I have a list of Utility Network elements, how can I pass them to the starting points parameter of this function?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 08:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1146095#M7811</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-02-21T08:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Utility network trace using geoprocessing tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1146345#M7817</link>
      <description>&lt;P&gt;Hi KarthikAditya,&lt;/P&gt;&lt;P&gt;For the required parameters, you cannot set it to default, but for the optional parameters, you can just put "" to keep it empty and set it as default. I would recommend returning your parameters in a block and then using the parameter variable in your ExecuteToolAsync() method to make your code cleaner and easier to read.&amp;nbsp;&lt;/P&gt;&lt;P&gt;var ParameterArray = await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;/{&lt;/P&gt;&lt;P&gt;return Geoprocessing.MakeValueArray("&lt;SPAN&gt;un.Trace", parameters, "", "", ""&lt;/SPAN&gt;);&lt;BR /&gt;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IGPResult result = await Geoprocessing.ExecuteToolAsync("geoprocessing tool you want to use here(e.g. management.SelectLayerByLocation)",ParameterArray);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope that helps.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 04:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1146345#M7817</guid>
      <dc:creator>ThiPham12</dc:creator>
      <dc:date>2022-02-22T04:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Utility network trace using geoprocessing tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1147427#M7836</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KarthikAditya_0-1645687776571.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34861i092F0E387215724E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KarthikAditya_0-1645687776571.png" alt="KarthikAditya_0-1645687776571.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion. However, when I pass empty strings "" to optional parameters to set them to default, I get the above error. My guess is that its not allowed. Any suggestion will be much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 07:33:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1147427#M7836</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-02-24T07:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Utility network trace using geoprocessing tool</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1147435#M7837</link>
      <description>&lt;P&gt;The function works now and a .json file with elements connectivity is created.&lt;/P&gt;&lt;P&gt;I had to pass all the parameters, including default values - I ran the Trace geoprocessing tool in ArcGIS Pro and referred to its Python command to get the correct parameter values and used it in my C# code.&lt;/P&gt;&lt;P&gt;The parameter values list of Utility Network Trace tool for reference:&lt;/P&gt;&lt;P&gt;var parameters = Geoprocessing.MakeValueArray(&lt;BR /&gt;"&lt;SPAN&gt;D:\\MyProject.gdb\\Communications"&lt;/SPAN&gt;,&lt;BR /&gt;"UPSTREAM",&lt;BR /&gt;"&lt;SPAN&gt;D:\\MyProject\\Default.gdb\\UN_Temp_Starting_Points"&lt;/SPAN&gt;,&lt;BR /&gt;null,&lt;BR /&gt;"Communications",//domain_network,&lt;BR /&gt;"Cable",//tier&lt;BR /&gt;"", //target tier&lt;BR /&gt;"", //subnetwork name&lt;BR /&gt;"", //shortest_path_network_attribute_name&lt;BR /&gt;"EXCLUDE_CONTAINERS",&lt;BR /&gt;"EXCLUDE_CONTENT",&lt;BR /&gt;"EXCLUDE_STRUCTURES",&lt;BR /&gt;"INCLUDE_BARRIERS",&lt;BR /&gt;"VALIDATE_CONSISTENCY",&lt;BR /&gt;null, //condition_barriers&lt;BR /&gt;null, //function_barriers&lt;BR /&gt;"BOTH_JUNCTIONS_AND_EDGES",//traversability_scope&lt;BR /&gt;null, //filter_barriers&lt;BR /&gt;null, //filter_function_barriers&lt;BR /&gt;"BOTH_JUNCTIONS_AND_EDGES",//filter_scope&lt;BR /&gt;"",//filter_bitset_network_attribute_name&lt;BR /&gt;"DO_NOT_FILTER",//filter_nearest&lt;BR /&gt;null, //nearest_count&lt;BR /&gt;"", //nearest_cost_network_attribute&lt;BR /&gt;null,//nearest_categories&lt;BR /&gt;null,//nearest_assets&lt;BR /&gt;null,//functions&lt;BR /&gt;null,//propagators&lt;BR /&gt;null,//output_assettypes&lt;BR /&gt;null,//output_conditions&lt;BR /&gt;//in_utility_network2,//output utility&lt;BR /&gt;"EXCLUDE_ISOLATED_FEATURES",&lt;BR /&gt;"DO_NOT_IGNORE_BARRIERS_AT_STARTING_POINTS",&lt;BR /&gt;"DO_NOT_INCLUDE_UP_TO_FIRST_SPATIAL_CONTAINER",&lt;BR /&gt;"CONNECTIVITY;SELECTION",//result_types&lt;BR /&gt;"NEW_SELECTION",&lt;BR /&gt;"CLEAR_ALL_PREVIOUS_TRACE_RESULTS",&lt;BR /&gt;"", //trace name&lt;BR /&gt;"Trace_Results_Aggregated_Points",&lt;BR /&gt;"Trace_Results_Aggregated_Lines",&lt;BR /&gt;"Trace_Results_Aggregated_Polygons",&lt;BR /&gt;"TRACE_INDETERMINATE_FLOW",&lt;BR /&gt;"DO_NOT_VALIDATE_LOCATABILITY",&lt;BR /&gt;"DO_NOT_USE_TRACE_CONFIGURATION",&lt;BR /&gt;"", //trace config name&lt;BR /&gt;"D:\\ArcGIS\\Projects\\MyProject\\connectivity.json",&lt;BR /&gt;"RUN_SYNCHRONOUSLY"&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 08:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/utility-network-trace-using-geoprocessing-tool/m-p/1147435#M7837</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-02-24T08:22:35Z</dc:date>
    </item>
  </channel>
</rss>

