ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / UtilityNetworkLayer Class / GetNamedTraceConfigurations Method
Example

In This Topic
    GetNamedTraceConfigurations Method (UtilityNetworkLayer)
    In This Topic
    Gets all of the named trace configurations within the utility network layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public IReadOnlyList<NamedTraceConfiguration> GetNamedTraceConfigurations()
    Public Function GetNamedTraceConfigurations() As IReadOnlyList(Of NamedTraceConfiguration)

    Return Value

    The list of named trace configurations associated with the layer.
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Could not get the named trace configurations.
    Example
    Fetch named trace configurations from a utility network layer
    private NamedTraceConfiguration GetNamedTraceConfigurationsFromUtilityNetworkLayer(UtilityNetworkLayer utilityNetworkLayer, string configurationName = "WaterNetwork")
    {
      // Get all named trace configurations in the utility network
      IReadOnlyList<NamedTraceConfiguration> namedTraceConfigurations = utilityNetworkLayer.GetNamedTraceConfigurations();
    
      foreach (NamedTraceConfiguration namedTraceConfiguration in namedTraceConfigurations)
      {
        if (namedTraceConfiguration.Name == configurationName)
        {
          return namedTraceConfiguration;
        }
      }
      return null;
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also