I am trying to symbolize a rubberband tracker as it is drawing. The default symbol is a simple black line. When setting the symbol of the line in the ScreenDisplay method and and calling DrawPolyline, the symbol I have set does appear but this is after the draw has completed.

I would like to have the symbol I set be shown once a single point has been created (while its tracking the next point), not just when the construction of the line has completed.

This functionality seems to be possible as I can easily do it in ArcMap - I can select any symbol and then create a new line feature and it displays the selected symbol while I draw it.

Edit: I noticed that it doesn't refresh as cleanly as the built in ArcMap tools do either. Strange, could there be some side effect happening? I've added two clips of what I experience and what I would like to have happen and exactly how I would like the line to look.

Result from this code:

Default Rubberband

What I would like:

Arrow Symbol Rubberband

Relevant Code:

IScreenDisplay screenDisplay = ArcMap.Document.ActiveView.ScreenDisplay;
screenDisplay.StartDrawing(screenDisplay.hDC, (int)esriScreenCache.esriNoScreenCache);

// Custom symbol I create gets cast as ISymbol...
ISymbol symbol = (ISymbol)cartographicLineSymbol;

IRubberBand2 rubberBand = new RubberLineClass();
ICurve2 rubberLine = (ICurve2)rubberBand.TrackNew(screenDisplay, symbol);

  • Did you try setting ISymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen ? gis.stackexchange.com/questions/13926/… – Kirk Kuykendall Sep 4 '18 at 22:39
  • I just tried this and it did not change the outcome. I've added some animations of what I experience and what I would like to see. While creating the animations I noticed that the rubberband from my custom tool does not refresh as quickly as the built in ArcMap tools do. – amasephy Sep 5 '18 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.