ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.CIM Namespace / PatchShape Enumeration
Example Example

In This Topic
    PatchShape Enumeration
    In This Topic
    Patch shapes.
    Syntax
    Members
    MemberDescription
    AreaBoundary An area boundary.
    AreaCircle An area circle.
    AreaEllipse An area ellipse.
    AreaFootprint An area footprint.
    AreaHexagonFlat A flat hexagon.
    AreaHexagonPointy A pointy hexagon.
    AreaHydroPoly An area hydro polygon.
    AreaNaturalPoly A natural area polygon.
    AreaPolygon An area polygon.
    AreaRectangle An area rectangle.
    AreaRoundedRectangle An area rounded rectangle.
    AreaSquare A square polygon.
    AreaTrapezium A trapezium.
    Default Default patch shape.
    LineAngles An angled line.
    LineArc A line arc.
    LineCorkscrew3D A 3D corkscrew line.
    LineCurve A curved line.
    LineHorizontal A horizontal line.
    LineHydro A hydro line.
    LineTrail A line representing a trail.
    LineVertical3D A vertical 3D line.
    LineZigZag A zig zag line.
    LineZigZag3D A 3D zig zag line.
    Point A point.
    Example
    Create Legend Patch Graphic
    //Must be on QueuedTask.Run(() => { ...
    
    //Build geometry
    List<Coordinate2D> plyCoords = new List<Coordinate2D>();
    plyCoords.Add(new Coordinate2D(1, 1));
    plyCoords.Add(new Coordinate2D(1.25, 2));
    plyCoords.Add(new Coordinate2D(1.5, 1.1));
    plyCoords.Add(new Coordinate2D(1.75, 2));
    plyCoords.Add(new Coordinate2D(2, 1.1));
    plyCoords.Add(new Coordinate2D(2.25, 2));
    plyCoords.Add(new Coordinate2D(2.5, 1.1));
    plyCoords.Add(new Coordinate2D(2.75, 2));
    plyCoords.Add(new Coordinate2D(3, 1));
    Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords);
    
    //Set symbolology, create and add element to layout
    CIMStroke outline = SymbolFactory.Instance.ConstructStroke(
              ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Solid);
    CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(
              ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline);
    
    var graphic = GraphicFactory.Instance.CreateLegendPatchGraphic(
                PatchShape.AreaBoundary, poly.Extent, polySym);
    
    //Make an element to add to GraphicsLayer or Layout
    //
    //var elemInfo = new ElementInfo()
    //{
    //  CustomProperties = null,
    //  Anchor = Anchor.LeftMidPoint
    //};
    //var ge = ElementFactory.Instance.CreateGraphicElement(container, graphic,
    //  "New Legend Patch", true, elemInfo);
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.CIM.PatchShape

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also