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

In This Topic
    Barriers Property (Traversability)
    In This Topic
    A conditional expression which terminates traversal if it evaluates to True.
    Syntax
    Public Property Barriers As Condition
    public Condition Barriers {get; set;}
    Example
    Create a Condition to compare a Network Attribute against a set of values
    {
      static void CreateNetworkAttributeComparison(UtilityNetworkDefinition utilityNetworkDefinition, TraceConfiguration traceConfiguration)
      {
        // This routine creates a NetworkAttributeComparison to compare the Lifecycle network attribute against two values: "In Design" and "In Service"
    
        const int InDesign = 4;
        const int InService = 8;
    
        // Create a NetworkAttribute object for the Lifecycle network attribute from the UtilityNetworkDefinition
        using NetworkAttribute lifecycleNetworkAttribute = utilityNetworkDefinition.GetNetworkAttribute("Lifecycle");
        // Create a NetworkAttributeComparison that stops traversal if Lifecycle <> "In Design" (represented by the constant InDesign)
        NetworkAttributeComparison inDesignNetworkAttributeComparison =
          new NetworkAttributeComparison(lifecycleNetworkAttribute, Operator.NotEqual, InDesign);
    
        // Create a NetworkAttributeComparison to stop traversal if Lifecycle <> "In Service" (represented by the constant InService)
        NetworkAttributeComparison inServiceNetworkAttributeComparison =
          new NetworkAttributeComparison(lifecycleNetworkAttribute, Operator.NotEqual, InService);
    
        // Combine these two comparisons together with "And"
        And lifecycleFilter = new And(inDesignNetworkAttributeComparison, inServiceNetworkAttributeComparison);
    
        // Final condition stops traversal if Lifecycle <> "In Design" and Lifecycle <> "In Service"
        traceConfiguration.Traversability.Barriers = lifecycleFilter;
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also