I have a utility network model, I need to create a startpoint on a subnetwork controller. I wish to use arcpy.un.AddTraceLocations to add a start point with the required fields (i.e. GID, TERMINALID) for a trace.
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: ( https://pro.arcgis.com/en/pro-app/latest/tool-reference/utility-networks/add-trace-locations.htm ) specifically this part:
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? 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.
I have tried replacing the input utility network model (first parameter) with a selection of a point from my UNM, which is created via arcpy.MakeFeatureLayer_management, then arcpy.SelectLayerByAttribute_management, but my starting points feature class remains empty.
My code:
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")