//Define a polyline between the two given points IPolyline polyline = new PolylineClass(); polyline.FromPoint = from_point; polyline.ToPoint = to_point; //Define the color of the line (black) IRgbColor colorEsri = new RgbColorClass(); colorEsri.Red = color.R; colorEsri.Green = color.G; colorEsri.Blue = color.B; //Create the final simple line, setting its properties ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol(); simpleLineSymbol.Color = colorEsri; simpleLineSymbol.Style = lineStyle; simpleLineSymbol.Width = width; //Create abd set the element that will contain the defined line //It's geometry will be the one of the polyline ILineElement element = new LineElementClass(); element.Symbol = simpleLineSymbol as ILineSymbol; IElement lineElement = (IElement)element; lineElement.Geometry = (IGeometry)polyline;