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


INetworkLoader.AddFeatureClass 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.AddFeatureClass Method
ArcGIS Developer Help

INetworkLoader.AddFeatureClass Method

Adds a feature class to the new geometric network.

[Visual Basic .NET]
Public Sub AddFeatureClass ( _
    ByVal featureClassName As String, _
    ByVal newFeatureType As esriFeatureType, _
    ByVal newClsID As UID, _
    ByVal canChangeGeometry As Boolean _
)
[C#]
public void AddFeatureClass (
    string featureClassName,
    esriFeatureType newFeatureType,
    UID newClsID,
    bool canChangeGeometry
);
[C++]
HRESULT AddFeatureClass(
  BSTR featureClassName,
  esriFeatureType newFeatureType,
  IUID* newClsID,
  VARIANT_BOOL canChangeGeometry
);
[C++]
Parameters
featureClassName [in]

featureClassName is a parameter of type BSTR newFeatureType [in]
newFeatureType is a parameter of type esriFeatureType newClsID [in]
newClsID is a parameter of type IUID* canChangeGeometry [in]
canChangeGeometry is a parameter of type bool

Product Availability

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

Errors Returned

The error "Cannot add a feature class to the geometric network", will be raised when AddFeatureClass is used with a feature type that is not permitted in a geometric network such as a Polygon, Multipoint, Multipatch, Dimension or Annotation feature class or with a feature class that participates in another controller dataset such as another geometric network, a topology, network dataset, terrain or fabric.

 

Remarks

A geometric network is built from feature classes. These feature classes must be contained within the feature dataset you specify. There are a few restrictions on which feature classes you can use. They must be either lines or points. They must not already be participating in a geometric network. In the case of SDE, they must not be registered as versioned.  You can check for any of these violations by calling the INetworkLoader2::CanUseFeatureClass method.

The NetworkLoader object can only build geometric networks with simple junction features, simple edge features, and complex edge features. You can look at the help for the NetworkFeature object for more information on these types of features.

The canChangeGeometry parameter indicates whether or not the feature's geometry can be modified during snapping.  If set to True, then the feature may be moved to snap to other features within the specified SnapTolerance.  If set to False, then the feature will not be moved to snap to other features.  This property can only be used when creating geometric networks in pre-10.0 geodatabases.  Starting with the 10.0 release; the parameter is ignored as the ability to allow snapping on a per feature class basis is no longer supported.  Snapping is now supported on all or nothing option, either all feature classes are snapped or none of the feature classes are snapped.  Use the INetworkLoader3::UseXYsForSnapping property to sepcify that all feature classes will be snapped during geometric network creation.

See Also

INetworkLoader Interface