ArcGIS Developer Help  (GeoDatabase)    

IObjectClass Interface

Provides access to members that return information about an object class.

Product Availability

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

When To Use

The IObjectClass interface is the main interface used to get the properties of an object class in a geodatabase. An object class is a feature class or table that has been registered with the geodatabase. For example, you can use the IObjectClass interface to get a list of all the relationship classes in which an object class participates.

Members

Description
Method AddField Adds a field to this object class.
Method AddIndex Adds an index to this object class.
Read-only property AliasName The alias name of the object class.
Read-only property CLSID The GUID for the COM Class (CoClass) corresponding to instances of this object class.
Method DeleteField Deletes a field from this object class.
Method DeleteIndex Deletes an index from this object class.
Read-only property EXTCLSID The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.
Read-only property Extension The extension for this object class.
Read-only property ExtensionProperties The extension properties for this object class.
Read-only property Fields The fields collection for this object class.
Method FindField The index of the field with the specified name.
Read-only property HasOID Indicates if the class has an object identity (OID) field.
Read-only property Indexes The indexes collection for this object class.
Read-only property ObjectClassID The unique ID for the object class.
Read-only property OIDFieldName The name of the field corresponding to the OID.
Read-only property RelationshipClasses The relationship classes in which this object class participates in for the specified role.

Inherited Interfaces

Interfaces Description
IClass Provides access to members that return information about and manage the class.

CoClasses that implement IObjectClass

CoClasses and Classes Description
FeatureClass FeatureClass Object.
NAClass (esriNetworkAnalyst)
ObjectClass ObjectClass Object.
RasterBand (esriDataSourcesRaster) A representation of a single band of a raster dataset on disk.
RasterCatalog A collection of raster datasets in a Geodatabase table.
RasterLayer (esriCarto) Raster layer source and display options.
RelQueryTable An object that joins two datasets based on common data values.
RouteEventSource (esriLocation) Route event source object.
SchematicDiagramClass (esriSchematic) Schematic diagram class object.
SchematicElementClass (esriSchematic) Schematic element class object.
TemporalFeatureClass (esriTrackingAnalyst) Controls settings for the temporal feature class.
XYEventSource XY event source object.

Remarks

All object classes support the IObjectClass interface and this interface inherits from the IClass interface. The CLSID, EXTCLSID, and Extension for an ObjectClass may be obtained via the corresponding methods inherited from IClass.

For programming convenience, pre-existing tables in the host RDBMS also support the IObjectClass interface even if they have not been registered with the geodatabase. Such tables can be distinguished from registered object classes because they return an ObjectClassID of -1 and return False to the HasOID method. New object classes in a geodatabase that are created using the CreateTable method on the IFeatureWorkspace interface are automatically registered with the geodatabase and assigned an object class ID.

If no AliasName has been defined for an object class, then the AliasName is equal
to the Name.

[Visual Basic 6.0]

The following two examples are code excerpts that show how to get to an IObjectClass interface in two different ways.

You can use the table of contents in ArcMap to get at a geodatabase table that may have been added.

Dim pDoc As IMxDocument

Dim pObjectClass As IObjectClass
Dim pContentsView As IContentsView
  
Set pDoc = ThisDocument
Set pContentsView = pDoc.CurrentContentsView
If pContentsView.Name = "Source" Then ' Have Source tab on TOC open
  If TypeOf pContentsView.SelectedItem Is IObjectClass Then
    Set pObjectClass = pContentsView.SelectedItem
  End If
End If

Alternatively you could use code to get the workspace object, then open the table you want to work with and QI for its IObjectClass  interface.

Dim pFact As IWorkspaceFactory

Set pFact = New SdeWorkspaceFactory

Dim pWorkspace As IWorkspace
Set pWorkspace = pFact.OpenFromFile("C:\\MyConnections\\redarrow_gdb.sde",0)

' QI for IFeatureWorkspace
Dim pFeatureWorkspace As IFeatureWorkspace
Set pFeatureWorkspace = pWorkspace
' Open a table
Dim pTable As ITable
Set pTable = pFeatureWorkspace.OpenTable("username.MyTable")

' QI for IObjectClass
Dim pObjectClass As IObjectClass
Set pObjectClass = pTable

See Also

IObjectClass Interface | IClass Interface | IClassSchemaEdit Interface

Example

IObjectClass Example

 


Feedback Send feedback on this page