Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault()?.GetLayout();
List<Element> elements = new List<Element>();
for (int i = 0; i < 100; i++)
{
List<Coordinate2D> lineCoordinates = new List<Coordinate2D> { new Coordinate2D { X = i, Y = 0 }, new Coordinate2D { X = i, Y = 100 } };
Polyline polylineTic = PolylineBuilder.CreatePolyline(lineCoordinates);
CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlackRGB, 1.0, SimpleLineStyle.Solid);
GraphicElement lineElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, polylineTic, lineSym);
CIMElement cimElement = lineElm.GetDefinition();
cimElement.Name = "Line" + i;
lineElm.SetDefinition(cimElement);
elements.Add(lineElm);
}
GroupElement groupElement = LayoutElementFactory.Instance.CreateGroupElement(layout, elements);
CIMElement cimGroupElement = groupElement.GetDefinition();
cimGroupElement.Name = "First Level Group";
groupElement.SetDefinition(cimGroupElement);