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


INAClassFieldMap.CreateMapping Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

INAClassFieldMap.CreateMapping Method

Creates a new field name mapping.

[Visual Basic .NET]
Public Sub CreateMapping ( _
    ByVal classDef As INAClassDefinition, _
    ByVal Fields As IFields _
)
[C#]
public void CreateMapping (
    INAClassDefinition classDef,
    IFields Fields
);
[C++]
HRESULT CreateMapping(
  INAClassDefinition* classDef,
  IFields* Fields
);
[C++]

Parameters classDef [in]
classDef is a parameter of type INAClassDefinition Fields [in]
Fields is a parameter of type IFields

Product Availability

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

Remarks

CreateMapping generates the default mapping for fields based on the inbound INAClassDefinition parameter.  The default mapping is based on matching the INAClassDefinition::CandidateFieldNames of the input INAClassDefinition to the field names in the input IFields parameter. Each matched field will be stored in the NAClassFieldMap object and is accessible via the MappedField method.

[C#]
INAClassFieldMap naClassFieldMap=new NAClassFieldMapClass();
naClassFieldMap.CreateMapping(inputNAClass.ClassDefinition, inputFeatureClass.Fields);
[Visual Basic .NET]
Dim naClassFieldMap as INAClassFieldMap=New NAClassFieldMap()
naClassFieldMap.CreateMapping(inputNAClass.ClassDefinition, inputFeatureClass.Fields)

See Also

INAClassFieldMap Interface

.NET Samples

Closest facility solver (Code Files: frmClosestFacilitySolver) | Service area solver (Code Files: frmServiceAreaSolver) | Location-allocation solver (Code Files: frmLocationAllocationSolver) | Vehicle routing problem solver (Code Files: frmVRPSolver) | Origin-destination cost matrix solver (Code Files: frmODCostMatrixSolver)