Representation Symbology

04-25-2012 06:08 PM
New Contributor II
I have a point layer file with representation symbology inside. When I add the layer file i want to symbolize it programmatically by its representation.

by default when the layer file is added to the map its symbology is the simple symbol which is the dot, I just want to activate the representation symbology embedded in the layer file as shown in the screenshot attached, programmatically.

Any information or help is highly appreciated. I attached the sample picture of the representation symbology that i'm talking about.


0 Kudos
2 Replies
Occasional Contributor III
Hey Francis,

If you need to set a representation programmatically you need to use the IREPRESENTATION interface.

Unfortunately, I don't have any .net code for you; however, I was able to find a VBA snippet which may help you.

Dim pFeat As IFeature
Dim pRep As IRepresentation  '------- IRepresentationClass::PrepareFilter
Dim pGeodataset As IGeoDataset
Dim pQf As IQueryFilter
Dim pCur As IFeatureCursor
Dim pMapContext As IMapContext
Dim dScale As Double
Dim pFC As IFeatureClass
Set pQf = New QueryFilter
pRepClass.PrepareFilter pQf     'Prepare QueryFilter
Set pMapContext = New MapContext
dScale = 25000
Set pFC = pRepClass.FeatureClass
Set pGeodataset = pFC
pMapContext.Init pGeodataset.SpatialReference, dScale, pGeodataset.extent
Set pCur = pFC.Search(pQf, False)   'Get a reference to featurecursor
Set pFeat = pCur.NextFeature            'Iterate through all features
Do Until pFeat Is Nothing
    'Get each feature representation
       Set pRep = pRepClass.GetRepresentation(pFeat, pMapContext) 
        'do something with representation here
        Set pFeat = pCur.NextFeature


0 Kudos
New Contributor II
I don't know if you still need help, but I think here
is better sample how to add layer with representation symbology.
If you need more help, send an e-mail to
0 Kudos