3

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.

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;
}

But 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.

2 Answers 2

3

I would write a custom display feedback.

1
  • right i manage to draw a line, now i can use the two points to create a polyline and put it in a feature layer. Thanks.
    – Kev84
    Commented Mar 30, 2011 at 20:27
0

I would probably cheat and set up a mouse event handler, when its entered check to see if the tool is selected and then on the second click, raise another click. I'm sure Kirk's way is much better though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.