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


INetworkLoader.AddWeightAssociation Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalysis > ESRI.ArcGIS.NetworkAnalysis > Interfaces > IN > INetworkLoader Interface > INetworkLoader.AddWeightAssociation Method
ArcGIS Developer Help

INetworkLoader.AddWeightAssociation Method

Adds an association between a network weight and a feature class attribute.

[Visual Basic .NET]
Public Sub AddWeightAssociation ( _
    ByVal networkWeightName As String, _
    ByVal featureClassName As String, _
    ByVal fieldName As String _
)
[C#]
public void AddWeightAssociation (
    string networkWeightName,
    string featureClassName,
    string fieldName
);
[C++]
HRESULT AddWeightAssociation(
  BSTR networkWeightName,
  BSTR featureClassName,
  BSTR fieldName
);
[C++]
Parameters
networkWeightName [in]

networkWeightName is a parameter of type BSTR featureClassName [in]
featureClassName is a parameter of type BSTR fieldName [in]
fieldName is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The weights you specified for your network using the AddWeight method need to have values. These values are taken from attributes of your feature classes. Adding weight associations tells the network which attributes belong to which weights. A weight can be associated with multiple feature classes. These associations are dependent on the type of field and the type of weight you created. The following table shows which types of weight can be associated to which types of feature attributes:

Weight Type Valid Feature Attribute Types
esriWTNull None
esriWTBitgate esriFieldTypeSmallInteger, esriFieldTypeInteger
esriWTInteger esriFieldTypeSmallInteger, esriFieldTypeInteger
esriWTSingle esriFieldTypeSingle
esriWTDouble esriFieldTypeSingle, esriFieldTypeDouble

You can only add a weight association to the network if both the feature class and the weight have already been added to the NetworkLoader object using the AddFeatureClass and AddWeight methods respectively.

See Also

INetworkLoader Interface | INetWeightAssociation Interface | INetWeightAssociationEdit Interface | NetWeightAssociation Class