<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to programatically create a line symbol with a Arrow at the endpoint. in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1218144#M8813</link>
    <description>&lt;P&gt;Hi Charles&lt;/P&gt;&lt;P&gt;Thanks a lot. The links were very use full for my project in general. In regard to your solution, it was working but I could not change the color of the marker (arrowhead).&lt;/P&gt;&lt;P&gt;I think it should be rather simple but setting the color in line 8 below does not seem to work. It got what I wanted using Wolf solution below so this it just my curiosity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;		private static CIMLineSymbol CreateArrowLineSymbol(System.Drawing.Color color)
		{
			var cimColor = ColorFactory.Instance.CreateColor(color);
			var symbol_layers = new List&amp;lt;CIMSymbolLayer&amp;gt;();
			var stroke = SymbolFactory.Instance.ConstructStroke(cimColor, 2.0);

			//End arrow
			var arrow = SymbolFactory.Instance.ConstructMarker(63, "ESRI Arrowhead", "Regular", 10, cimColor) as CIMCharacterMarker;

			//Marker placement on end - Both, JustBegin, JustEnd
			var endMarkerPlacement = new CIMMarkerPlacementAtExtremities()
			{
				ExtremityPlacement = ExtremityPlacement.JustEnd,
				PlacePerPart = false,
				AngleToLine = true,
			};
			arrow.MarkerPlacement = endMarkerPlacement;

			//reverse Z-order
			symbol_layers.Add(arrow);
			symbol_layers.Add(stroke);
			var CIMLineSymbol = new CIMLineSymbol()
			{
				SymbolLayers = symbol_layers.ToArray()
			};
			return CIMLineSymbol;
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Oct 2022 20:05:37 GMT</pubDate>
    <dc:creator>StephenCochrane</dc:creator>
    <dc:date>2022-10-02T20:05:37Z</dc:date>
    <item>
      <title>How to programatically create a line symbol with a Arrow at the endpoint.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214520#M8773</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to programmatically construct a simple line symbol using ArcGIS pro sdk for .net. It should show the features with an arrow at the end node of each feature (and only at the end node). I am not sure if need to use line symbol with marker symbols (it seems a bit complicated for a relative simple symbol).&lt;/P&gt;&lt;P&gt;I the old ArcMap application I am migrating i had this code for the symbol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;		private static CartographicLineSymbolClass CreateArrowSymbol(Color c)
		{
			var color = new RgbColorClass() { Red = c.R, Green = c.G, Blue = c.B };
			var de = new SimpleLineDecorationElementClass();
			de.AddPosition(1);
			de.MarkerSymbol = new ArrowMarkerSymbolClass() { Color = color, Size = 8.0, Length = 6.0 };
			var ld = new LineDecorationClass();
			ld.AddElement(de);

			var symbol = new CartographicLineSymbolClass()
			{
				Color = color,
				Width = 1.5,
				LineDecoration = ld
			};
			return symbol;
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 10:01:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214520#M8773</guid>
      <dc:creator>StephenCochrane</dc:creator>
      <dc:date>2022-09-21T10:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically create a line symbol with a Arrow at the endpoint.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214645#M8774</link>
      <description>&lt;P&gt;Stephen, i cover symbology in quite some depth here:&amp;nbsp;&lt;A href="https://mediaspace.esri.com/media/t/1_sjql4zul" target="_self"&gt;ArcGIS Pro SDK for .NET: An Introduction to the Use of the CIM with Symbology in Pro&lt;/A&gt;&amp;nbsp;(from Dev summit 2021)&amp;nbsp; and, specifically, arrow heads: 48:30 ish&lt;/P&gt;&lt;P&gt;ppt and code is here:&amp;nbsp;&lt;A href="https://esri.github.io/arcgis-pro-sdk/techsessions/2021/PalmSprings/CIMSymbology.zip" target="_self"&gt;https://esri.github.io/arcgis-pro-sdk/techsessions/2021/PalmSprings/CIMSymbology.zip&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to use something called a&amp;nbsp;CIMMarkerPlacementAtExtremities and apply that to your arrow marker. Along these lines (no pun intended):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; var symbol_layers = new List&amp;lt;CIMSymbolLayer&amp;gt;();
 var stroke = SymbolFactory.Instance.ConstructStroke(
   		ColorFactory.Instance.BlackRGB, 2.0);
 //End arrow
 var arrow = SymbolFactory.Instance.ConstructMarker(
   		63, "ESRI Arrowhead", "Regular", 10) as CIMCharacterMarker;

 //Marker placement on end - Both, JustBegin, JustEnd
 var endMarkerPlacement = new CIMMarkerPlacementAtExtremities() {
   ExtremityPlacement = ExtremityPlacement.JustEnd,
   PlacePerPart = false,
   AngleToLine = true
 };
 arrow.MarkerPlacement = endMarkerPlacement;

 //reverse Z-order
 symbol_layers.Add(arrow);
 symbol_layers.Add(stroke);

 var CIMLineSymbol = new CIMLineSymbol() {
   SymbolLayers = layers.ToArray()
 };&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Sep 2022 15:16:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214645#M8774</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-09-21T15:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically create a line symbol with a Arrow at the endpoint.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214795#M8776</link>
      <description>&lt;P&gt;Stephen, you can also use a pre-defined arrow symbol using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (_lineSymbol == null)
{
  //Get all styles in the project
  var styleProjectItem2D = Project.Current.GetItems&amp;lt;StyleProjectItem&amp;gt;().FirstOrDefault(s =&amp;gt; s.Name == "ArcGIS 2D");
  await QueuedTask.Run(() =&amp;gt;
  {
    //Get a specific project style by name
    var arrowLineSymbol = styleProjectItem2D.SearchSymbols(StyleItemType.LineSymbol, "Arrow Line 2 (Mid)")[0];
    if (arrowLineSymbol == null) return;
    _lineSymbol = arrowLineSymbol.Symbol;
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example symbology will look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1663789107788.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51800i1FF552440AE6AC7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1663789107788.png" alt="Wolf_0-1663789107788.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I attached a sample tool code snippet that shows the symbology using a graphic overlay.&lt;/P&gt;&lt;P&gt;EDIT: please substitute the SearchSymbol string using the following to get an arrow at the end:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;styleProjectItem2D.SearchSymbols(StyleItemType.LineSymbol, "Bold Arrow 2")[0];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1663794606223.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51815iCFD4CCDAB1B91C1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1663794606223.png" alt="Wolf_0-1663794606223.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 21:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1214795#M8776</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-09-21T21:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically create a line symbol with a Arrow at the endpoint.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1218144#M8813</link>
      <description>&lt;P&gt;Hi Charles&lt;/P&gt;&lt;P&gt;Thanks a lot. The links were very use full for my project in general. In regard to your solution, it was working but I could not change the color of the marker (arrowhead).&lt;/P&gt;&lt;P&gt;I think it should be rather simple but setting the color in line 8 below does not seem to work. It got what I wanted using Wolf solution below so this it just my curiosity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;		private static CIMLineSymbol CreateArrowLineSymbol(System.Drawing.Color color)
		{
			var cimColor = ColorFactory.Instance.CreateColor(color);
			var symbol_layers = new List&amp;lt;CIMSymbolLayer&amp;gt;();
			var stroke = SymbolFactory.Instance.ConstructStroke(cimColor, 2.0);

			//End arrow
			var arrow = SymbolFactory.Instance.ConstructMarker(63, "ESRI Arrowhead", "Regular", 10, cimColor) as CIMCharacterMarker;

			//Marker placement on end - Both, JustBegin, JustEnd
			var endMarkerPlacement = new CIMMarkerPlacementAtExtremities()
			{
				ExtremityPlacement = ExtremityPlacement.JustEnd,
				PlacePerPart = false,
				AngleToLine = true,
			};
			arrow.MarkerPlacement = endMarkerPlacement;

			//reverse Z-order
			symbol_layers.Add(arrow);
			symbol_layers.Add(stroke);
			var CIMLineSymbol = new CIMLineSymbol()
			{
				SymbolLayers = symbol_layers.ToArray()
			};
			return CIMLineSymbol;
		}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2022 20:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1218144#M8813</guid>
      <dc:creator>StephenCochrane</dc:creator>
      <dc:date>2022-10-02T20:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to programatically create a line symbol with a Arrow at the endpoint.</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1218145#M8814</link>
      <description>&lt;P&gt;Thanks a lot, Wolf.&lt;/P&gt;&lt;P&gt;It worked super.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2022 20:08:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-programatically-create-a-line-symbol-with-a/m-p/1218145#M8814</guid>
      <dc:creator>StephenCochrane</dc:creator>
      <dc:date>2022-10-02T20:08:49Z</dc:date>
    </item>
  </channel>
</rss>

