ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMFilteredFindPathsConfiguration Class / PathMode Property
Example

In This Topic
    PathMode Property
    In This Topic
    Gets or sets whether the filtered find paths algorithm searches for shortest paths, for lowest cost paths or for all paths.
    Syntax
    Public Property PathMode As KGPathMode
    public KGPathMode PathMode {get; set;}
    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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also