ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMMarkerPlacementAlongLineSameSize Class
Members Example

In This Topic
    CIMMarkerPlacementAlongLineSameSize Class
    In This Topic
    Represents marker placement along the line which places markers that are the same size evenly along a line or polygon outline.
    Object Model
    CIMMarkerPlacementAlongLineSameSize ClassCIMMarkerPlacementAlongLineSameSize ClassCIMMarkerPlacementAlongLineSameSize Class
    Syntax
    Example
    Snippet Markers placed at a 45 degree angle
    /// <summary>
    /// Create a line symbol with the markers placed at a 45 degree angle. <br/>  
    /// ![LineSymbolAngleMarker](http://Esri.github.io/arcgis-pro-sdk/images/Symbology/line-marker-angle.png)
    /// </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;
      });
    }
    Snippet Dash line with two markers - Method I
    /// <summary>
    /// Create a line symbol with a dash and two markers.<br/>          
    /// </summary>
    /// <remarks>
    /// This line symbol comprises three symbol layers listed below: 
    /// 1. A solid stroke that has dashes.
    /// 1. A circle marker.
    /// 1. A square marker.
    /// ![LineSymbolTwoMarkers](http://Esri.github.io/arcgis-pro-sdk/images/Symbology/line-dash-two-markers.png)
    /// </remarks>
    /// <returns></returns>
    internal static Task<CIMLineSymbol> CreateLineDashTwoMarkersAync()
    {
      return QueuedTask.Run<CIMLineSymbol>(() =>
      {
    
        var dash2MarkersLine = new CIMLineSymbol();
    
        var mySymbolLyrs = new CIMSymbolLayer[]
              {
                    new CIMSolidStroke()
                    {
                        Color = ColorFactory.Instance.BlackRGB,
                        Enable = true,
                        ColorLocked = true,
                        CapStyle = LineCapStyle.Round,
                        JoinStyle = LineJoinStyle.Round,
                        LineStyle3D = Simple3DLineStyle.Strip,
                        MiterLimit = 10,
                        Width = 1,
                        CloseCaps3D = false,
                        Effects = new CIMGeometricEffect[]
                        {
                            new CIMGeometricEffectDashes()
                            {
                                CustomEndingOffset = 0,
                                DashTemplate = new double[] {20, 10, 20, 10},
                                LineDashEnding = LineDashEnding.HalfPattern,
                                OffsetAlongLine = 0,
                                ControlPointEnding = LineDashEnding.NoConstraint
                            },
                            new CIMGeometricEffectOffset()
                            {
                                Method = GeometricEffectOffsetMethod.Bevelled,
                                Offset = 0,
                                Option = GeometricEffectOffsetOption.Fast
                            }
                        },
                    },
                    CreateCircleMarkerPerSpecs(),
                    CreateSquareMarkerPerSpecs()
          };
        dash2MarkersLine.SymbolLayers = mySymbolLyrs;
        return dash2MarkersLine;
      });
    }
    private static CIMMarker CreateCircleMarkerPerSpecs()
    {
      var circleMarker = SymbolFactory.Instance.ConstructMarker(ColorFactory.Instance.BlackRGB, 5, SimpleMarkerStyle.Circle) as CIMVectorMarker;
      //Modifying the marker to align with line
      //First define "markerplacement"
      CIMMarkerPlacementAlongLineSameSize markerPlacement = new CIMMarkerPlacementAlongLineSameSize()
      {
        AngleToLine = true,
        Offset = 0,
        Endings = PlacementEndings.Custom,
        OffsetAlongLine = 15,
        PlacementTemplate = new double[] { 60 }
      };
      //assign the markerplacement to the marker
      circleMarker.MarkerPlacement = markerPlacement;
      return circleMarker;
    }
    private static CIMMarker CreateSquareMarkerPerSpecs()
    {
      var squareMarker = SymbolFactory.Instance.ConstructMarker(ColorFactory.Instance.BlueRGB, 5, SimpleMarkerStyle.Square) as CIMVectorMarker;
      CIMMarkerPlacementAlongLineSameSize markerPlacement2 = new CIMMarkerPlacementAlongLineSameSize()
      {
        AngleToLine = true,
        Endings = PlacementEndings.Custom,
        OffsetAlongLine = 45,
        PlacementTemplate = new double[] { 60 },
      };
      squareMarker.MarkerPlacement = markerPlacement2;
      return squareMarker;
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMMarkerPlacement
             ArcGIS.Core.CIM.CIMMarkerStrokePlacement
                ArcGIS.Core.CIM.CIMMarkerPlacementAlongLine
                   ArcGIS.Core.CIM.CIMMarkerPlacementAlongLineSameSize

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also