<?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 How can I select a UNM Feature to put into arcpy.un.AddTraceLocations() in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-can-i-select-a-unm-feature-to-put-into-arcpy/m-p/1328102#M68621</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have a utility network model, I need to create a startpoint on a subnetwork controller. I wish to use &lt;STRONG&gt;arcpy.un.AddTraceLocations&lt;/STRONG&gt; to add a start point with the required fields (i.e. GID, TERMINALID) for a trace.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have this, which runs (see code block below), but does not output any data into the generated feature class at "D:\cons\UNM.sde\StartingPoints", it creates the headers, but there is no actual data rows. In the documentation: (&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/add-trace-locations.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/add-trace-locations.htm&lt;/A&gt;&amp;nbsp;) specifically this part:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edc_0-1694573931555.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80551i771A4296010D6D50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edc_0-1694573931555.png" alt="edc_0-1694573931555.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;implies I can use LOAD_SELECTED_FEATURES to populate the new starting points feature class with selected features. How do I go about selecting this from the utility network model input inside my python script?&amp;nbsp; How can I load in the required data format and how would I make a selection on that data? I wish to select one device.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried replacing the input utility network model (first parameter) with a selection of a point from my UNM, which is created via&amp;nbsp;&lt;STRONG&gt;arcpy.MakeFeatureLayer_management&lt;/STRONG&gt;, then&amp;nbsp;&lt;STRONG&gt;arcpy.SelectLayerByAttribute_management&lt;/STRONG&gt;, but my starting points feature class remains empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.un.AddTraceLocations(r"https://gishub.test/server/rest/services/UNM/Utility_Network_Model/FeatureServer/0", r"D:\cons\UNM.sde\StartingPoints", "LOAD_SELECTED_FEATURES", "CLEAR_LOCATIONS")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 03:09:59 GMT</pubDate>
    <dc:creator>EddX</dc:creator>
    <dc:date>2023-09-13T03:09:59Z</dc:date>
    <item>
      <title>How can I select a UNM Feature to put into arcpy.un.AddTraceLocations()</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-select-a-unm-feature-to-put-into-arcpy/m-p/1328102#M68621</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a utility network model, I need to create a startpoint on a subnetwork controller. I wish to use &lt;STRONG&gt;arcpy.un.AddTraceLocations&lt;/STRONG&gt; to add a start point with the required fields (i.e. GID, TERMINALID) for a trace.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have this, which runs (see code block below), but does not output any data into the generated feature class at "D:\cons\UNM.sde\StartingPoints", it creates the headers, but there is no actual data rows. In the documentation: (&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/add-trace-locations.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/add-trace-locations.htm&lt;/A&gt;&amp;nbsp;) specifically this part:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edc_0-1694573931555.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80551i771A4296010D6D50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edc_0-1694573931555.png" alt="edc_0-1694573931555.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;implies I can use LOAD_SELECTED_FEATURES to populate the new starting points feature class with selected features. How do I go about selecting this from the utility network model input inside my python script?&amp;nbsp; How can I load in the required data format and how would I make a selection on that data? I wish to select one device.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have tried replacing the input utility network model (first parameter) with a selection of a point from my UNM, which is created via&amp;nbsp;&lt;STRONG&gt;arcpy.MakeFeatureLayer_management&lt;/STRONG&gt;, then&amp;nbsp;&lt;STRONG&gt;arcpy.SelectLayerByAttribute_management&lt;/STRONG&gt;, but my starting points feature class remains empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.un.AddTraceLocations(r"https://gishub.test/server/rest/services/UNM/Utility_Network_Model/FeatureServer/0", r"D:\cons\UNM.sde\StartingPoints", "LOAD_SELECTED_FEATURES", "CLEAR_LOCATIONS")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 03:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-select-a-unm-feature-to-put-into-arcpy/m-p/1328102#M68621</guid>
      <dc:creator>EddX</dc:creator>
      <dc:date>2023-09-13T03:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I select a UNM Feature to put into arcpy.un.AddTraceLocations()</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-select-a-unm-feature-to-put-into-arcpy/m-p/1329215#M68646</link>
      <description>&lt;P&gt;Why are you using LOAD_SELECTED_FEATURES when you can just pass the trace locations through the trace_locations parameter? Seems like extra work to generate a selection instead of just passing features to the tool.&lt;/P&gt;&lt;P&gt;I also think that for selections to work you need to be accessing a feature layer as the map/layer object holds selection state. If you're working directly with a data source, you'll need to pass through features directly instead of loading a selection from a view that it doesn't exist in.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 18:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-select-a-unm-feature-to-put-into-arcpy/m-p/1329215#M68646</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2023-09-15T18:30:27Z</dc:date>
    </item>
  </channel>
</rss>

