I was wondering if there is a way to draw a polyline but with an arrow head at the end point?

IPolyline line = new PolylineClass();
  • I think this is more of a symbology question than a polyline-creation question. Have you tried what's in this thread ? – Kirk Kuykendall Apr 7 '11 at 20:07
  • but if i use a symbol, that means i cannot control the direction of the arrow head. – Kev84 Apr 7 '11 at 20:43
  • Using a cartographiclinesymbol, the arrow can be either at the beginning or the end of the polyline. Do you want the polyline to contain extra points at the end representing the shape of the arrow head? – Kirk Kuykendall Apr 7 '11 at 20:47
  • I currently have a line created with source and sink, i read your sample thread, but that's drawing a line, i already have a line, can you provide me some sample with using the cartographiclinesymbol? Thanks – Kev84 Apr 7 '11 at 22:38

Assuming you have already an IFeatureLayer object called featLayer:

SimpleLineDecorationElementClass de = new SimpleLineDecorationElementClass();
de.MarkerSymbol = new ArrowMarkerSymbolClass();

LineDecorationClass ld = new LineDecorationClass();

CartographicLineSymbolClass cl = new CartographicLineSymbolClass();
cl.Width = 1;
cl.LineDecoration = ld;

SimpleRendererClass sr = new SimpleRendererClass();
sr.Symbol = cl;
((IGeoFeatureLayer)featLayer).Renderer = sr;
| improve this answer | |
  • Great AndOne, now is there a way to get rid of the arrow? I"m doing a show/hide context menu in TOC. I tried setting the renderer to null but didn't work – Kev84 Jun 23 '11 at 14:31

Just go in to the symbology menu and scroll down until you see an option for this type of line symbology (arrow at start, end, etc). If you're using ArcGIS 10, you even have the option to search for symbology by a certain parameter (ex - typing "helicopter" will bring you to a number of symbology options related to that keyword). If you're using ArcGIS 9, you can also add different symbol sets to your array of options. I only have ArcView 9.3, but the print screen I attached shows you what you need.
Hope this helps, Dano enter image description here

| improve this answer | |
  • thanks, but i want to achieve this by using ArcEngine 10 backend code. using c# and .net 4 + WPF – Kev84 Apr 12 '11 at 14:31
  • Way out of my league .... sorry I couldn't help. – Dano Apr 12 '11 at 16:19

Thanks to Dano for "pointing" me in this direction.

The following is my workaround for arrows in ArcView 9.3

-Create a polyline shapefile

-Add the shapefile to the map

-Use Editor to draw the line

-Navigate to the Symbol Selector and scroll down in the list and select either Arrow Right Middle or Arrow Left Middle

-The color of the line can be changed easily but the color of the arrow must be changed by navigating to Properties > Line Properties > Line Decorations: > Properties

-Number of positions = number of arrowheads; the cartographic symbol has only one arrowhead on the line

-Navigate to Symbol to change the color and size of the arrowheads

-Select multiple Oks to accept selections

| improve this answer | |
  • Welcome to GIS SE! Something to be aware of is that your answers should directly address the question, and in this case there is a requirement for an ArcGIS Engine (ArcObjects) solution and what you have provided uses the ArcGIS Desktop GUI. – PolyGeo Jul 16 '14 at 21:22

Your Answer

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

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