This document is archived and information here might be outdated.  Recommended version.


Statements - Set Closest Facility Properties Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Statements - Set Closest Facility Properties Snippet

Set closest facility solver parameters.

[C#]
//<-- Snippet Start -->
// DESCRIPTION:

// Set closest facility solver parameters, including settings for...
ESRI.ArcGIS.NetworkAnalyst.INAClosestFacilitySolver naClosestFacilitySolver=naSolver as ESRI.ArcGIS.NetworkAnalyst.INAClosestFacilitySolver;

// ...default cutoff
naClosestFacilitySolver.DefaultCutoff=Nothing;

// ...number of facilities to find
naClosestFacilitySolver.DefaultTargetFacilityCount=1;

// ...travel direction
naClosestFacilitySolver.TravelDirection=ESRI.ArcGIS.NetworkAnalyst.esriNATravelDirection.esriNATravelDirectionToFacility;

// ...output
naClosestFacilitySolver.CreateTraversalResult=true;
naClosestFacilitySolver.OutputLines=ESRI.ArcGIS.NetworkAnalyst.esriNAOutputLineType.esriNAOutputLineTrueShape;

//<-- Snippet End -->
[Visual Basic .NET]
'<-- Snippet Start -->
' DESCRIPTION:

' Set closest facility solver parameters, including settings for...
Dim naClosestFacilitySolver As ESRI.ArcGIS.NetworkAnalyst.INAClosestFacilitySolver=CType(naSolver, ESRI.ArcGIS.NetworkAnalyst.INAClosestFacilitySolver)

' ...default cutoff
naClosestFacilitySolver.DefaultCutoff=Nothing

' ...number of facilities to find
naClosestFacilitySolver.DefaultTargetFacilityCount=1

' ...travel direction
naClosestFacilitySolver.TravelDirection=ESRI.ArcGIS.NetworkAnalyst.esriNATravelDirection.esriNATravelDirectionToFacility

' ...output
naClosestFacilitySolver.CreateTraversalResult=True
naClosestFacilitySolver.OutputLines=ESRI.ArcGIS.NetworkAnalyst.esriNAOutputLineType.esriNAOutputLineTrueShape

'-- Snippet End -->

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.NetworkAnalyst