{
//Note: Must be on QueuedTask.Run
//List of Point graphics
var listGraphics = new List<CIMPointGraphic>();
var listGraphicsFactory = new List<CIMPointGraphic>();
//Symbol
var pointSymbol = SymbolFactory.Instance.ConstructPointSymbol(
ColorFactory.Instance.BlackRGB);
//Define size of the array
int dx = 5;
int dy = 5;
MapPoint point = null;
//Create the List of graphics for the array
for (int row = 0; row <= dx; ++row)
{
for (int col = 0; col <= dy; ++col)
{
point = MapPointBuilderEx.CreateMapPoint(col, row);
//create a CIMGraphic
var graphic = new CIMPointGraphic()
{
Symbol = pointSymbol.MakeSymbolReference(),
Location = point
};
listGraphics.Add(graphic);
//Or use GraphicFactory
var graphicFactory = GraphicFactory.Instance.CreateSimpleGraphic(
point, pointSymbol) as CIMPointGraphic;
listGraphicsFactory.Add(graphicFactory);
}
}
//Draw the array of graphics
var bulkgraphics = ElementFactory.Instance.CreateGraphicElements(
layout, listGraphics);
var bulkgraphicsFactory = ElementFactory.Instance.CreateGraphicElements(
layout, listGraphicsFactory);
}