ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / Traversability Class / FunctionBarriers Property
Example

In This Topic
    FunctionBarriers Property (Traversability)
    In This Topic
    A set of FunctionBarrier objects. If any of these objects evaluates to true, further traversal is terminated.
    Syntax
    Public Property FunctionBarriers As IReadOnlyList(Of FunctionBarrier)
    public IReadOnlyList<FunctionBarrier> FunctionBarriers {get; set;}
    Example
    Create a FunctionBarrier
    {
      // This routine creates a FunctionBarrier that stops traversal when the total shape length exceeds 1000 feet
      static void CreateFunctionBarrier(UtilityNetworkDefinition utilityNetworkDefinition, TraceConfiguration traceConfiguration)
      {
        // Create a NetworkAttribute object for the Shape length network attribute from the UtilityNetworkDefinition
        using NetworkAttribute shapeLengthNetworkAttribute = utilityNetworkDefinition.GetNetworkAttribute("Shape length");
        // Create a function that adds up shape length
        Add lengthFunction = new Add(shapeLengthNetworkAttribute);
    
        // Create a function barrier that stops traversal after 1000 feet
        FunctionBarrier distanceBarrier = new FunctionBarrier(lengthFunction, Operator.GreaterThan, 1000.0);
    
        // Set this function barrier
        traceConfiguration.Traversability.FunctionBarriers = new List<FunctionBarrier>() { distanceBarrier };
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also