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


IFeatureDataset.CreateFeatureClass Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

IFeatureDataset.CreateFeatureClass Method

Creates a new FeatureClass in this FeatureDataset.

[Visual Basic .NET]
Public Function CreateFeatureClass ( _
    ByVal Name As String, _
    ByVal Fields As IFields, _
    ByVal CLSID As UID, _
    ByVal EXTCLSID As UID, _
    ByVal FeatureType As esriFeatureType, _
    ByVal ShapeFieldName As String, _
    ByVal ConfigKeyword As String _
) As IFeatureClass
[C#]
public IFeatureClass CreateFeatureClass (
    string Name,
    IFields Fields,
    UID CLSID,
    UID EXTCLSID,
    esriFeatureType FeatureType,
    string ShapeFieldName,
    string ConfigKeyword
);
[C++]
HRESULT CreateFeatureClass(
  BSTR Name,
  IFields* Fields,
  IUID* CLSID,
  IUID* EXTCLSID,
  esriFeatureType FeatureType,
  BSTR ShapeFieldName,
  BSTR ConfigKeyword,
  IFeatureClass** FeatureClass
);
[C++]

Parameters Name [in] Name is a parameter of type BSTR Fields [in]
Fields is a parameter of type IFields CLSID [in]
CLSID is a parameter of type IUID EXTCLSID [in]
EXTCLSID is a parameter of type IUID FeatureType [in]
FeatureType is a parameter of type esriFeatureType ShapeFieldName [in] ShapeFieldName is a parameter of type BSTR ConfigKeyword [in] ConfigKeyword is a parameter of type BSTR FeatureClass [out, retval]
FeatureClass is a parameter of type IFeatureClass

Product Availability

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

Errors Returned

If an EXTCLSID is provided that does not correspond with a registered class extension, CreateFeatureClass will return an error.

If fields of type esriFieldTypeOID and esriFieldTypeGeometry are not present in the field set, CreateFeatureClass will return an error.

Functional License Check

If your application/site is not appropriately licensed, CreateFeatureClass can return an error of FDO_E_NO_SCHEMA_LICENSE.

Remarks

Use the CreateFeatureClass method in the IFeatureDataset interface to create a new feature class within a FeatureDataset. The arguments to this method are the same as to the CreateFeatureClass method in IFeatureWorkspace. However, this method requires that the spatial reference specified for the feature class to be created match the spatial reference of the feature dataset. Note that the spatial reference for the feature class to be created is specified in the GeometryDef property of the Field object for the Shape field in the supplied Fields collection. The GeometryDef object must be fully set up with information on both the spatial reference (the projected or geographic coordinate system, vertical coordinate system, the coordinate domains and the coordinate resolution values), and the spatial index for the shape Field before calling CreateFeatureClass.

The following are valid Geometry types for a new feature class (from esriGeometryType) and are set on the GeometryDef object:

esriGeometryPoint

esriGeometryMultipoint

esriGeometryPolyline

esriGeometryPolygon

esriGeometryMultiPatch

If the FeatureWorkspace the FeatureClass is being created in is a Geodatabase workspace then at a minimum the Fields object must contain the the required fields. The required fields can be obtained from the class description for the type of object you wish to create (see the RequiredFields property on IObjectClassDescription).

The Fields object passed to the Fields parameter should not be an object retrieved from another class. If the new class is going to have the same fields as an existing class, cast the existing class' fields collection to the IClone interface, clone it, and use the cloned fields collection as input for this method.

The optional CLSID parameter is used to specify what GUID to use to instantiate the object representing a feature in that FeatureClass. If "Nothing" is passed in for the CLSID, the GeoDatabase will use the CLSID corresponding to esriGeoDatabase.Feature. This is OK in most instances. If you know the FeatureClass has a custom Feature other than esriGeoDatabase.Feature, you can pass in it's GUID at this time or later call methods on the FeatureClass's IClassSchemaEdit interface.

The optional EXTCLSID parameter specifies the GUID to use to instantiate the object representing the FeatureClassExtension. This object must at least support the IClassExtension interface. If you pass in "Nothing" for the EXTCLSID, the newly created FeatureClass will not have a ClassExtension. Since ClassExtensions are not required, this is generally OK, unless the FeatureClass is for annotation, dimension lines or a custom FeatureClass that requires a ClassExtension. If you know the FeatureClass has a ClassExtension and you know the GUID for the ClassExtension, you can pass it in at this time or later call methods on the FeatureClass's IClassSchemaEdit interface.

The optional configurationKeyword parameter allows the application to control the physical layout for this table in the underlying RDBMS—for example, in the case of an Oracle database, the configuration keyword controls the tablespace in which the table is created, the initial and next extents, and other properties. The configurationKeywords for an ArcSDE instance are set up by the ArcSDE data administrator, the list of available keywords supported by a workspace may be obtained using the IWorkspaceConfiguration interface.

Note: Table or feature class names with the following prefixes are not supported:


 ~ "gdb_"
 ~ "sde_"
 ~ "delta_"

See Also

IFeatureDataset Interface

.NET Snippets

Create FeatureClass

.NET Related Topics

Creating feature classes