Adding SimpleFillSymbol to ArcMap document

Discussion created by kuiperfoliage on Sep 23, 2011
Latest reply on Sep 26, 2011 by jeffhamblin

I'm trying to add a SimpleFillSymbol to an ArcMap document on a specific location on the document/map.

I tried a couple of thing, but failed and i'm pretty sure this should be a relatively easy task.

I was trying to use the GraphicsContainer to add an element which contains the Symbol but couldn't get it working.

Can anybody give me some pointers on how to achieve this?

This is what i'm trying to do:

IMxDocument document = ArcMap.Application.Document as IMxDocument;
IMap map = document.FocusMap;
IGraphicsContainer graphicsContainer = document.PageLayout as IGraphicsContainer;

ISimpleFillSymbol symbol = myObject.Symbol;

...code which adds the symbol to the element...
...code to set the geometry (x,y and width and height)...

graphicsContainer.AddElement(element, 0); 

Thank you very much!