Ok, I have achieved to access the object, but I still don't know how to modify it. The way to get the object is the following:
List<IGraphicsContainer> graphicsContainers = GISUtil.layers.get_LayerSymbols_graphicContainerAll(ref map);
graphicsContainers.Add(((IGraphicsContainer)(IActiveView)map.Map));
for (int i = 0; i < graphicsContainers.Count; i++)
{
graphicsContainers.Reset();
IElement element = graphicsContainers.Next();
while (element != null)
{
element = graphicsContainers.Next();
}
}
public List<IGraphicsContainer> get_LayerSymbols_graphicContainerAll(ref AxMapControl map) {
List<IGraphicsContainer> result = new List<IGraphicsContainer>();
//Try to get the requested symbols layer as a graphics layer. If none was found, return the map's main one.
try {
ICompositeLayer mainGraphicsLayer = (ICompositeLayer)map.get_Layer(0);
for (int i = 0; i < mainGraphicsLayer.Count; i++) {
result.Add((IGraphicsContainer)mainGraphicsLayer.get_Layer(i));
}
}
catch (Exception e) {
LogFile.appendLine_error(e);
}
return result;
}
The problem of this object is that I cannot cast it to anything, when I see information in Intellisense about the object, it is a System.__ComObject. Other objects in the map are ESRI.ArcGIS.Carto.MarkerElementClass or ESRI.ArcGIS.Carto.TextElementClass. Also, I don't know programatically if the object I am accessing to is the picture drawn, or another type of object. I know that its geometry type is esriGeometryType.esriGeometryPolyline, but I have more polylines in the map, so I cannot differentiate it...