Provides access to members that return and modify subtype information.
ISubtypes interface is a member of the ObjectClass coclass and is used to maintain information about subtypes for the object class. Subtypes can be removed, added, and retrieved using this interface. Also default subtypes and subtypecodes can be set for the object class here.
| Description | ||
|---|---|---|
![]() |
AddSubtype | Adds the subtype to the set of associated subtypes. |
![]() |
DefaultSubtypeCode | The default subtype associated with the class. |
![]() |
DefaultValue | The default value for the associated attribute. |
![]() |
DeleteSubtype | Deletes the subtype from the set of associated subtypes. |
![]() |
Domain | The domain given the subtype and field. |
![]() |
HasSubtype | Indicates if the table has subtypes. |
![]() |
SubtypeFieldIndex | The subtype field index. |
![]() |
SubtypeFieldName | The subtype field name. |
![]() |
SubtypeName | The subtype name. |
![]() |
Subtypes | The subtypes associated with the class. |
| CoClasses and Classes | Description |
|---|---|
| FeatureClass | FeatureClass Object. |
| NetCDFFeatureClass (esriDataSourcesNetCDF) | An in-memory representation of a NetCDF feature class. |
| ObjectClass | ObjectClass Object. |
| RouteEventSource (esriLocation) | Route event source object. |
| SchematicDiagramClass (esriSchematic) | Schematic diagram class object. |
| SchematicElementClass (esriSchematic) | Schematic element class object. |
| XYEventSource | XY event source object. |
//e.g., nameOfFeatureClass = "land_use";
//on ArcSDE use ISqlSyntax::QualifyTableName for fully qualified table names.
public ISubtypes getISubtypes(IWorkspace workspace, string nameOfFeatureClass)
{
IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)workspace;
IFeatureClass featureClass = featureWorkspace.OpenFeatureClass(nameOfFeatureClass);
ISubtypes subtypes = (ISubtypes)featureClass;
return subtypes;
}
The following two examples are code excerpts that show how to get to an ISubtypes interface with Visual Basic for Applications and Visual Basic respecitvly.
When using VBA, you can get the ISubtypes interface from a layer in ArcMap's table of contents
Dim pFeatcls As IFeatureClass
Dim pFeatLayer As IFeatureLayer
Dim pDoc As IMxDocument
Dim pMap As IMap
Dim pSubtypes As ISubtypes
Set pDoc = ThisDocument
Set pMap = pDoc.Maps.Item(0)
Set pFeatLayer = pMap.Layer(0)
Set pFeatcls = pFeatLayer.FeatureClass
Set pSubtypes = pFeatcls
With Visual Basic, you are working outside of the application, so you need to use code to get the workspace object that contains the feature class, then get the ISubtypes interface from the feature class. This example has the location of the connection file for the workspace hard-coded, but you could use the mini-browser to browse to the workspace, or the feature class.
Dim pFact As IWorkspaceFactory
Set pFact = New SdeWorkspaceFactory
Dim pWorkspace As IWorkspace
Set pWorkspace = pFact.OpenFromFile("C:\MyConnections\redarrow_gdb.sde",0)
Dim pFeatws As IFeatureWorkspace
Set pFeatws = pWorkspace
Dim pFeatcls As IFeatureClass
Set pFeatcls = pFeatws.OpenFeatureClass("gdb.Buildings_net")
Dim pSubtypes As ISubtypes
Set pSubtypes = pFeatcls
You can get the ISubtypes interface from the following objects:
FeatureClass
ObjectClass
Table