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


INASolverSettings.RestrictionAttributeNames Property (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

INASolverSettings.RestrictionAttributeNames Property

The collection of network attribute names to be used as restrictions with the analysis.

[Visual Basic .NET]
Public Property RestrictionAttributeNames As IStringArray
[C#]
public IStringArray RestrictionAttributeNames {get; set;}
[C++]
HRESULT get_RestrictionAttributeNames(
  IStringArray** AttributeName
);
[C++]
HRESULT putref_RestrictionAttributeNames(
  IStringArray* AttributeName
);
[C++]

Parameters AttributeName [out, retval]
AttributeName is a parameter of type IStringArray AttributeName [in]
AttributeName is a parameter of type IStringArray

Product Availability

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

Remarks

RestrictionAttributeNames provides access to an IStringArray with the list of attribute names being used as restrictions by a network analyst solver. For example, the route solver could solve the shortest path using both oneway restrictions and bridge height restrictions.

If the solver is not using any restriction attributes, this method will return a string array with 0 elements in it.

The get property returns a copy of the IStringArray.  You must explicitly set the property after modifying the contents of the IStringArray.

[C#]

This sample illustrates adding some additional attributes to use as restrictions:

   IStringArray restrictionAttributeNames=naSolverSettings.RestrictionAttributeNames;
   restrictionAttributeNames.Add("Oneway");
   restrictionAttributeNames.Add("RestrictedTurns");
   naSolverSettings.RestrictionAttributeNames=restrictionAttributeNames;

See Also

INASolverSettings Interface

.NET Samples

ArcGIS Network Analyst extension Engine application (Code Files: frmNALayerProperties)