ArcObjects Library Reference (Display)  

IRepresentationRuleInit.InitWithSymbol Method

Initializes the representation rule with a symbol.

[Visual Basic .NET]
Public Sub InitWithSymbol ( _
    ByVal Symbol As ISymbol _
)
[C#]
public void InitWithSymbol (
    ISymbol Symbol
);
[C++]
HRESULT InitWithSymbol(
  ISymbol* Symbol
);
[C++]

Parameters

Symbol [in]

  Symbol is a parameter of type ISymbol

Product Availability

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

Remarks

Use this piece of code to create and initilize a regular ArcGIS symbol to a RepresentationRule object.

Public Sub RepRuleInit()
      Dim pRepresentationRules As IRepresentationRules
      Dim pDiamond As ISimpleMarkerSymbol
      Dim pRepresentationRule As IRepresentationRule
      Dim pRepRuleInit As IRepresentationRuleInit
      Dim lDiamondID As Long
      
      'Create new RepresentationRules for this Representation Class
      Set pRepresentationRules = New RepresentationRules
      
      'Create new Simple Marker Symbol (diamond)
      Set pDiamond = New SimpleMarkerSymbol
      pDiamond.Style = esriSMSDiamond
      pDiamond.size = 4
      
      'Create a new RepresentationRule using a SimpleMarkerSymbol object that implements ISymbol interface and add to Collection
      Set pRepresentationRule = New RepresentationRule
      Set pRepRuleInit = pRepresentationRule
      pRepRuleInit.InitWithSymbol pDiamond
      'Initializes with standard ArcGIS symbols
      lDiamondID = pRepresentationRules.Add(pRepresentationRule)
      pRepresentationRules.Name(lDiamondID) = "diamond"
End Sub

See Also

IRepresentationRuleInit Interface