com.esri.arcgis.display
Interface IRepresentationRule

All Superinterfaces:
Serializable
All Known Subinterfaces:
IRepresentationRule2
All Known Implementing Classes:
RepresentationRule

public interface IRepresentationRule
extends Serializable

Provides access to members that control a representation rule.

Remarks

IRepresentationRule interface provides access to the members of a single representation rule used by a representation class to draw the individual feature representations. A representation rule consists of one or more basic symbol layers namely BasicLineSymbol, BasicFillSymbol and BasicMarkerSymbol. In addition to the symbol layers, a representation rule may also contain geometric effects.

The following code snippet shows how to get access to a RepresentationRule object given with its name. The name of the representation rule can be changed to get access to a different representation rule.

  Dim pRepRules As IRepresentationRules
Dim pRepRule As IRepresentationRule
Dim lID As Long, sName As String
Set pRepRules = pRepClass.RepresentationRules
'walk through the representationrules and get a specific rule with given name
pRepRules.Reset
pRepRules.Next lID, pRepRule
Do Until pRepRule Is Nothing
If pRepRules.Name(lID) = "Buildings_Rule" Then Exit Do
pRepRules.Next lID, pRepRule
Loop

When To Use

Use IRepresentationRule interface to get reference to the individual representation rule objects present in the RepresentationRules collection for a representation class.

Product Availability

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


Method Summary
 void draw(int index, IOutputContext context, IGeometry geometry, IEnvelope envelope)
          Draws a layer of a representation rule.
 IBasicSymbol getLayer(int index)
          Layer at a given index.
 int getLayerCount()
          Number of layers in the representation rule.
 void insertLayer(int index, IBasicSymbol symbol)
          Adds a layer to the representation rule.
 void removeLayer(int index)
          Removes a layer from the representation rule.
 

Method Detail

getLayerCount

int getLayerCount()
                  throws IOException,
                         AutomationException
Number of layers in the representation rule.

Product Availability

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

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayer

IBasicSymbol getLayer(int index)
                      throws IOException,
                             AutomationException
Layer at a given index.

Product Availability

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

Parameters:
index - The index (in)
Returns:
A reference to a com.esri.arcgis.display.IBasicSymbol
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insertLayer

void insertLayer(int index,
                 IBasicSymbol symbol)
                 throws IOException,
                        AutomationException
Adds a layer to the representation rule.

Product Availability

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

Parameters:
index - The index (in)
symbol - A reference to a com.esri.arcgis.display.IBasicSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeLayer

void removeLayer(int index)
                 throws IOException,
                        AutomationException
Removes a layer from the representation rule.

Remarks

If RemoveLayer method is used to remove the very last symbol layer present in a representation rule, it is the responsibility of the developer to add atleast one symbol layer. Use InsertLayer or IRepresentationRuleInit::InitWithSymbol methods to achieve this.

Product Availability

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

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

draw

void draw(int index,
          IOutputContext context,
          IGeometry geometry,
          IEnvelope envelope)
          throws IOException,
                 AutomationException
Draws a layer of a representation rule. If index is -1, all layers are drawn.

Product Availability

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

Parameters:
index - The index (in)
context - A reference to a com.esri.arcgis.display.IOutputContext (in)
geometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
envelope - A reference to a com.esri.arcgis.geometry.IEnvelope (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.