ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMFilteredFindPathsConfiguration Class / ClosedPathPolicy Property
Example

In This Topic
    ClosedPathPolicy Property
    In This Topic
    Gets or sets the closed path policy, i.e whether we allow, forbid, or require that the start and end vertices of a path are equal. When the value is KGClosedPathPolicy.Require, the DestinationEntities field is ignored and destinations entities are the same as origin entities.
    Syntax
    public KGClosedPathPolicy ClosedPathPolicy {get; set;}
    Public Property ClosedPathPolicy As KGClosedPathPolicy
    Example
    Run FFP Using Defaults
          //using ArcGIS.Core.Data.Knowledge.Extensions;
    
          await QueuedTask.Run(() =>
    {
              var ffp_config = new CIMFilteredFindPathsConfiguration();
              ffp_config.Name = "Run FFP Using Defaults";
    
              //Origin Entities
              var originEntities = new List<CIMFilteredFindPathsEntity>();
    
              var poi_entity = new CIMFilteredFindPathsEntity();
              poi_entity.EntityTypeName = "POI";//All entities of entity type "POI"
              poi_entity.PropertyFilterPredicate = "";
              originEntities.Add(poi_entity);
              //Add the CIMFilteredFindPathsEntity to the OriginEntities collection
              ffp_config.OriginEntities = originEntities.ToArray();
    
              //Destination Entities
              var destEntities = new List<CIMFilteredFindPathsEntity>();
    
              var supp_entity = new CIMFilteredFindPathsEntity();
              supp_entity.EntityTypeName = "Supplier";//All entities of entity type "Supplier"
              supp_entity.PropertyFilterPredicate = "";
              destEntities.Add(supp_entity);
    
              //Add the CIMFilteredFindPathsEntity to the DestinationEntities collection
              ffp_config.DestinationEntities = destEntities.ToArray();
    
              //Path Filters
              ffp_config.PathFilters = [];//Empty
              //Traversal
              ffp_config.TraversalDirections = [];//Empty
    
              //Other
              ffp_config.RelationshipCostProperty = "";
              ffp_config.DefaultRelationshipCost = 1.0;
              ffp_config.DefaultTraversalDirectionType = KGTraversalDirectionType.Any;
              ffp_config.EntityUsage = FilteredFindPathsEntityUsage.AnyOriginAnyDestination;
              ffp_config.PathMode = KGPathMode.Shortest;
              ffp_config.MinPathLength = (int)1;//Min number of relationships in path
              ffp_config.MaxPathLength = (int)8;//Max number of relationships in path
              ffp_config.MaxCountPaths = (int)100000;//Total number of paths to return
              ffp_config.ClosedPathPolicy = KGClosedPathPolicy.Forbid;
              ffp_config.TimeFilter = null;
    
              var results = kg.RunFilteredFindPaths(ffp_config);
              //TODO process/analyze results
          });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also