Move Representation marker symbol in ArcObjects (C#.Net)

1004
3
04-29-2018 09:38 PM
SatyanarayanaChallaboyana
New Contributor II

I am working on representation movement tool. In my project I want to move representation symbol (Only move representation symbol not feature geometry) within 15 feet from 3 way or 4 way junction. I got representation feature but I have searched option for representation moment in Arc Objects C#.Net. Please help me for my problem.

 

IRepresentation Interface (http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esriGeoDatabase/IRepresentation.htm)

After Getting Representation feature how to get and move Representation marker symbol in arcobjects:

 

IFeatureLayer sysVal_layer = new FeatureLayerClass();

sysVal_layer.FeatureClass = SystemValve;

double scale = 9600;                                  

IMapContext pMapCText = new MapContextClass();

IGeoFeatureLayer pGFlayer = sysVal_layer as IGeoFeatureLayer;

IGeoDataset pgeodSet = sysVal_layer as IGeoDataset;

pMapCText.Init(pgeodSet.SpatialReference, scale, pgeodSet.Extent);

if (cnt == 1)

{

if (pGFlayer.Renderer is IRepresentationRenderer)

       {

                                           //Get Representation from feature.

IRepresentationRenderer prepReder = pGFlayer.Renderer as IRepresentationRenderer;

IRepresentationClass pRepCl = prepReder.RepresentationClass;

IRepresentation RepreFeature = pRepCl.GetRepresentation(valveF, pMapCText);

if (RepreFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)

{

       IGraphicAttributes graphicAtt = pRepCl.GraphicAttributes as IGraphicAttributes;

       int RuleID = RepreFeature.RuleID;

0 Kudos
3 Replies
SatyanarayanaChallaboyana
New Contributor II

Hi Team any one can help me for getting representation marker symbol in C#.Net ArcObjects.

0 Kudos
MarkusBedel
Esri Contributor
Not sure I understand your question with the information provided.
Below an example how to modify the X/Y-Offset of the "On Point" Marker Placement of a Marker:
// get RepresentationRule for current Representation
IRepresentationRule rule = repClass.RepresentationRules.Rule[representation.RuleID];

// assume that RuleLayer 0 is the Marker
IBasicMarkerSymbol basicMarkerSymbol = rule.Layer[0] as IBasicMarkerSymbol;

// get GraphicAttributes of the Marker
IGraphicAttributes attributes = basicMarkerSymbol.MarkerPlacement as IGraphicAttributes;

// on the Representation set value for X/Y-Offset
representation.set_Value(attributes, esriMarkerPlacementAttributes.esriGAOnPointXOffset, 5);
representation.set_Value(attributes, esriMarkerPlacementAttributes.esriGAOnPointYOffset, 5);

Not sure if this is the right approach, though. Depending on data and symbology it will be entirely different
0 Kudos
JeffMatson
Occasional Contributor III

Assuming you set up your representation's geometry editing behavior to use Override geometry, you can set IRepresentation.Shape to the modified geometry, then call IRepresentation.UpdateFeature() and finally call IFeature.Store().

0 Kudos