ConstructLineSymbol(CIMColor,Double,SimpleLineStyle) Method
Constructs a line symbol of specific color, width and style.
How to construct a line symbol of specific color, size and line style
CIMLineSymbol lineSymbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlueRGB, 4.0, SimpleLineStyle.Solid);
Snippet Markers placed at a 45 degree angle
/// <summary>
/// Create a line symbol with the markers placed at a 45 degree angle. <br/>
/// 
/// </summary>
/// <returns></returns>
internal static Task<CIMLineSymbol> CreateMyMarkerLineSymbolAsync()
{
return QueuedTask.Run<CIMLineSymbol>(() =>
{
//Create a marker from the "|" character. This is the marker that will be used to render the line layer.
var lineMarker = SymbolFactory.Instance.ConstructMarker(124, "Agency FB", "Regular", 12);
//Default line symbol which will be modified
var blackSolidLineSymbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlackRGB, 2, SimpleLineStyle.Solid);
//Modifying the marker to align with line
//First define "markerplacement"
CIMMarkerPlacementAlongLineSameSize markerPlacement = new CIMMarkerPlacementAlongLineSameSize()
{
AngleToLine = true,
PlacementTemplate = new double[] { 5 }
};
//assign the markerplacement to the marker
lineMarker.MarkerPlacement = markerPlacement;
//angle the marker if needed
lineMarker.Rotation = 45;
//assign the marker as a layer to the line symbol
blackSolidLineSymbol.SymbolLayers[0] = lineMarker;
return blackSolidLineSymbol;
});
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.