[GIS] way to make a straight line in ArcEngine 10 (Polyline but with ONLY start and end)

arcgis-10.0arcgis-enginepolyline-creation

So I want to allow the user to create a connection between 2 polygons on my map. So it doesn't make sense to allow them to draw polyline with multi points.

My question is, is there a way I can do something like below BUT ONLY with 1 start and 1 end point?

private IPolyline DrawLine(IActiveView activeView, int x, int y)
{
    IPolyline line = null;
    IRubberBand rubberBand = new RubberLineClass();
    ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();

    if (activeView != null)
        line = rubberBand.TrackNew(activeView.ScreenDisplay, (ISymbol)simpleLineSymbol) as IPolyline;

    return line;
}

Problem is i don't want the user to have to double click at the last point, it could be confusing for user, i want them to click – create start point, click – create end point.

Thanks,
Kevin

Best Answer

I would write a custom display feedback.