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 );
ParametersfeatureClassName [in] featureClassName is a parameter of type BSTR newFeatureType [in]
newFeatureType is a parameter of type esriFeatureTypenewClsID [in]
newClsID is a parameter of type IUIDcanChangeGeometry [in] canChangeGeometry is a parameter of type VARIANT_BOOL
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.
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.