Representation Symbology

473
2
04-25-2012 06:08 PM
FrancisSacdalan
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.

Thanks,

Francis
0 Kudos
2 Replies
NelsonDe_Miranda
Occasional Contributor III
Hey Francis,

If you need to set a representation programmatically you need to use the IREPRESENTATION interface.
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//002500000n3s000000

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
Loop


Cheers,

Nelson
0 Kudos
RadekMandovec
New Contributor II
I don't know if you still need help, but I think here http://resources.esri.com/help/9.3/arcgisdesktop/com/samples/Cartography/Representations/26ADCF02-6E...
is better sample how to add layer with representation symbology.
If you need more help, send an e-mail to manni.m@seznam.cz
0 Kudos