ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SymbolFactory Class / ConstructMarker Method / ConstructMarker(CIMColor,Double,SimpleMarkerStyle) Method
ArcGIS.Core.CIM.CIMColor
The size of the marker to construct.
SimpleMarkerStyle
Example

In This Topic
    ConstructMarker(CIMColor,Double,SimpleMarkerStyle) Method
    In This Topic
    Constructs a marker of specific color, size and style. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function ConstructMarker( _
       ByVal color As CIMColor, _
       ByVal size As Double, _
       ByVal markerStyle As SimpleMarkerStyle _
    ) As CIMMarker

    Parameters

    color
    ArcGIS.Core.CIM.CIMColor
    size
    The size of the marker to construct.
    markerStyle
    SimpleMarkerStyle

    Return Value

    Exceptions
    ExceptionDescription
    This method must be called within the lambda passed to QueuedTask.Run
    Example
    How to construct a point symbol from a marker
    await QueuedTask.Run(() =>
    {
      CIMMarker marker = SymbolFactory.Instance.ConstructMarker(ColorFactory.Instance.GreenRGB, 8.0, SimpleMarkerStyle.Pushpin);
      CIMPointSymbol pointSymbolFromMarker = SymbolFactory.Instance.ConstructPointSymbol(marker);
    });
    How to construct a multilayer line symbol with circle markers on the line ends
    //These methods must be called within the lambda passed to QueuedTask.Run
    var lineStrokeRed = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.RedRGB, 4.0);
    var markerCircle = SymbolFactory.Instance.ConstructMarker(ColorFactory.Instance.RedRGB, 12, SimpleMarkerStyle.Circle);
    markerCircle.MarkerPlacement = new CIMMarkerPlacementOnVertices()
    {
      AngleToLine = true,
      PlaceOnEndPoints = true,
      Offset = 0
    };
    var lineSymbolWithCircles = new CIMLineSymbol()
    {
      SymbolLayers = new CIMSymbolLayer[2] { markerCircle, lineStrokeRed }
    };
    
    How to construct a multilayer line symbol with an arrow head on the end
    //These methods must be called within the lambda passed to QueuedTask.Run
    var markerTriangle = SymbolFactory.Instance.ConstructMarker(ColorFactory.Instance.RedRGB, 12, SimpleMarkerStyle.Triangle);
    markerTriangle.Rotation = -90; // or -90
    markerTriangle.MarkerPlacement = new CIMMarkerPlacementOnLine() { AngleToLine = true, RelativeTo = PlacementOnLineRelativeTo.LineEnd };
    
    var lineSymbolWithArrow = new CIMLineSymbol()
    {
      SymbolLayers = new CIMSymbolLayer[2] { markerTriangle,
                  SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.RedRGB, 2)
              }
    };
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also