ArcObjects Library Reference (NetworkAnalyst)  

INAServer.GetSolverParameters Method

Default solver parameters for the specified network analysis layer.

[Visual Basic .NET]
Public Function GetSolverParameters ( _
    ByVal NALayerName As String _
) As INAServerSolverParams
[C#]
public INAServerSolverParams GetSolverParameters (
    string NALayerName
);
[C++]
HRESULT GetSolverParameters(
  BSTR NALayerName,
  INAServerSolverParams** NAServerSolverParams
);
[C++]

Parameters

NALayerName [in]   NALayerName is a parameter of type BSTR NAServerSolverParams [out, retval]

  NAServerSolverParams is a parameter of type INAServerSolverParams

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Remarks

GetSolverParameters returns the  NAServerSolverParams object (NAServerRouteParams, NAServerClosestFacilityParams, NAServerServiceAreaParams, NAServerLocationAllocationParams, NAServerODCostMatrixParams, NAServerVRPParams) corresponding to the NALayer name passed in.  The parameter object returned will have defaults based on the NALayer it is referencing. 

You can pass this resulting object into the Solve method on INAServer to perform network analysis.

 

[C#]

//Example of code showing how to get the solver parameters of a route network analysis layer associated to a MapServer Objects:

 

//connect to the server and get access to the server context for the MapServer objects

ServerConnection conn = new ESRI.ArcGIS.Server.WebControls.ServerConnection("MyMachine",true);

IServerObjectManager pSOM = conn.ServerObjectManager;

IServerContext pServerContext = pSOM.CreateServerContext("MyMapServerObjects", "MapServer");

 

// Get access to the MapServer and NAServer Interfaces

IMapServer pMapServer = pServerContext.ServerObject as IMapServer;

IServerObjectExtensionManager soex = pMapServer as IServerObjectExtensionManager;

IServerObjectExtension sext = soex.FindExtensionByName("NAServer");

INAServer naServer = sext as INAServer;

 

// Retrieve the list of Routes NALayers for this MapServer objects

string[] naLayers = naServer.GetNALayerNames(ESRI.ArcGIS.NetworkAnalyst.esriNALayerType.esriNALayerRoute);

 

// get access to the NASolverParameters for the first layer

if (naLayers.GetLength(0) >= 1)

      INAServerSolverParams solverParams = naServer.GetSolverParameters(naLayers[0]) as  INAServerSolverParams;

See Also

INAServer Interface

.NET Samples

Closest facility application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ClosestFacility_GISServerAPIClass) | Route application using the NAServer extension in ArcGIS Server via a GIS client (Code Files: Route_GISClientClass) | Route application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: Route_GISServerAPIClass) | Service area application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ServiceArea_GISServerAPIClass) |