ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMHatchFill Class
Members Example

In This Topic
    CIMHatchFill Class
    In This Topic
    Represents a hatch fill which fills polygonal geometry with a uniform series of parallel line symbols.
    Object Model
    CIMHatchFill ClassCIMHatchFill ClassCIMHatchFill ClassCIMLineSymbol Class
    Syntax
    Example
    Snippet Diagonal cross hatch fill
    /// <summary>
    /// Create a polygon symbol with a diagonal cross hatch fill. <br/>
    /// ![PolygonSymbolDiagonalCrossHatch](http://Esri.github.io/arcgis-pro-sdk/images/Symbology/polygon-diagonal-crosshatch.png)
    /// </summary>
    /// <returns></returns>
    public static Task<CIMPolygonSymbol> CreateDiagonalCrossPolygonAsync()
    {
      return QueuedTask.Run<CIMPolygonSymbol>(() =>
      {
        var trans = 50.0;//semi transparent
        CIMStroke outline = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, trans), 2.0, SimpleLineStyle.Solid);
    
        //Stroke for the fill
        var solid = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(255, 0, 0, trans), 1.0, SimpleLineStyle.Solid);
    
        //Mimic cross hatch
        CIMFill[] diagonalCross =
                  {
                    new CIMHatchFill() {
                        Enable = true,
                        Rotation = 45.0,
                        Separation = 5.0,
                        LineSymbol = new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[1] { solid } }
                    },
                    new CIMHatchFill() {
                        Enable = true,
                        Rotation = -45.0,
                        Separation = 5.0,
                        LineSymbol = new CIMLineSymbol() { SymbolLayers = new CIMSymbolLayer[1] { solid } }
                    }
          };
        List<CIMSymbolLayer> symbolLayers = new List<CIMSymbolLayer>
          {
                    outline
          };
        foreach (var fill in diagonalCross)
          symbolLayers.Add(fill);
        return new CIMPolygonSymbol() { SymbolLayers = symbolLayers.ToArray() };
      });
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMSymbolLayer
             ArcGIS.Core.CIM.CIMFill
                ArcGIS.Core.CIM.CIMHatchFill

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also