ArcObjects Library Reference  (GeoDatabase)    

IRepresentationClass Interface

Provides access to members that control the behavior and properties of a feature class representation.

Product Availability

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

When To Use

Use IRepresentationClass to access a feature class representation to either view, copy, or make changes to RepresentationRulesGraphicAttributes and RequireShapeOverride properties.

Members

Description
Read-only property FeatureClass Feature class associated with this representation class.
Method GetRepresentation Returns the representation of a given feature.
Read/write property GraphicAttributes Class attributes Property.
Read-only property ID ID of the representation class.
Read-only property OverrideFieldIndex Field index of the override field.
Method PrepareFilter Adds the fields used by overrides to the query filter.
Read/write property RepresentationRules RepresentationRules Property.
Read/write property RequireShapeOverride Indicates if a shape override is required for feature representations.
Read-only property RuleIDFieldIndex Field index of the Rule ID field.

CoClasses that implement IRepresentationClass

CoClasses and Classes Description
RepresentationClass A Feature Class Representation object.

Remarks

IRepresentationClass interface has properties and methods used to manage the ReresentationClass object. 

A RepresentationClass is a feature class that has been enabled with representation capability. Creating a new feature class representation will result in addition of two new fields corresponding to the RuleID and Override fields. RuleID fIeld stores ID values of representation rules which are used to represent individual feature representations. Override field contains information about representation overrides. Default values for overrides are set to null. RuleIDFieldIndex and OverrideFieldIndex properties return field indices for RuleID and Override fields respectively.

FeatureClass property returns a reference to the feature class that the representation class belongs to. A representation class cannot exist on its own. Deleting a feature class will delete all representation classes associated with it. Drop Representation geoprocessing tool can be used to remove feature class representations.

RepresentationRules property can be used to access the collection of representation rules present for a representation class or to create a new representation rules object from scratch. A single representation class can have multiple representation rules.

GraphicAttributes property returns a reference to the graphic attributes present for the representation class namely, visibility. To make changes to this property use IGraphicAttributes interface. Changes made at representation class level are applied to all representations. Individual representation's visibility property can also be overriden using IRepresentation::Value property.

Use GetRepresentation method to get access to representations for individual features within the feature class with respect to a specific MapContext object listed in the esriDisplay library. A MapContext object is defined using Spatial Reference and Reference Scale information.

PrepareFilter method prepares a query filter by adding RuleID, Override and explicit override fields as the sub-fields. 

ID property returns the unique identifier that identifies the representation class in a geodatabase.

Use IRepresentationWorkspaceExtension::OpenRepresentationClass method to open a specific representation class given its name within a workspace.

 

 

[C#]

IMxDocument pMxDoc ;
pMxDoc = m_App.Document;
IMap pMap;
pMap = pMxDoc.FocusMap;
IFeatureLayer pFeatLayer;
pFeatLayer = (IFeatureLayer)pMap.get_Layer(0);
IGeoFeatureLayer pGeoFeatLayer;
pGeoFeatLayer = (IGeoFeatureLayer)pFeatLayer;
IRepresentationRenderer pRepRenderer;
IRepresentationClass pRepClasss;
if (typeof(pGeoFeatLayer) is IRepresentationRenderer)
{
  pRepRenderer = (IRepresentationRenderer)pGeoFeatLayer.Renderer;
  pRepClasss = pRepRenderer.RepresentationClass;
}
[Visual Basic 6.0]

The following piece of code shows how to get reference to a representation class using a feature layer in ArcMap which has been rendered using representation renderer.

  Dim pMxDoc as IMxDocument 
Set pMxDoc = ThisDocument
Dim pMap as IMap
Set pMap = pMxDoc.FocusMap
Dim pFeatLayer as IFeatureLayer
Set pFeatLayer = pMap.Layer(0)
Dim pGeoFeatLayer as IGeoFeatureLayer
Set pGeoFeatLayer = pFeatLayer
Dim pRepRenderer as IRepresentationRenderer
Dim pRepClass as IRepresentationClass
If TypeOf pGeoFeatLayer is RepresentationRenderer then
    Set pRepRenderer = pGeoFeatLayer.Renderer
    Set pRepClass = pRepRenderer.RepresentationClass
End If 

The following piece of code shows how to get reference to a representation class given its name and a reference to a feature class in a geodatabase (pfclass).

  Dim pRepWSExt as IRepresentationWorkspaceExtension
  Dim pRepClass as IRepresentationClass
  Dim pDataset As IDataset
  Dim pWorkspace As IWorkspace
  Dim pExtManager As IWorkspaceExtensionManager
  Dim pUID As IUID
  
  Set pDataset = pfclass
  Set pWorkspace = pDataset.Workspace
  Set pExtManager = pWorkspace
  Set pUID = New UID
  pUID.Value = "{FD05270A-8E0B-4823-9DEE-F149347C32B6}"
  Set pRepWSExt = pExtManager.FindExtension(pUID)
  Set pRepClass = pRepWSExt.OpenRepresentationClass("River_Rep")
  

 


Feedback Send feedback on this page