ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SymbolFactory Class / ConstructStroke Method / ConstructStroke(CIMColor,Double,SimpleLineStyle,Simple3DLineStyle,Simple3DLineAnchor) Method
ArcGIS.Core.CIM.CIMColor
The width of stroke to construct.
SimpleLineStyle
ArcGIS.Core.CIM.Simple3DLineStyle
ArcGIS.Core.CIM.Simple3DLineAnchor. This property is ignored for the 3D line styles of Wall and Strip.
Example

In This Topic
    ConstructStroke(CIMColor,Double,SimpleLineStyle,Simple3DLineStyle,Simple3DLineAnchor) Method
    In This Topic
    Constructs a 3D stroke of specific color, width and style.
    Syntax

    Parameters

    color
    ArcGIS.Core.CIM.CIMColor
    width
    The width of stroke to construct.
    lineStyle
    SimpleLineStyle
    lineStyle3D
    ArcGIS.Core.CIM.Simple3DLineStyle
    anchor3D
    ArcGIS.Core.CIM.Simple3DLineAnchor. This property is ignored for the 3D line styles of Wall and Strip.

    Return Value

    Remarks
    Example
    Create rectangle graphic with simple symbology
    {
      //Create a simple 2D rectangle graphic and apply simple fill and
      //outline symbols.
    
      //Note: Must be on QueuedTask.Run
    
      //Build 2D envelope geometry
      Coordinate2D rec_ll = new Coordinate2D(1.0, 4.75);
      Coordinate2D rec_ur = new Coordinate2D(3.0, 5.75);
    
      Envelope rec_env = EnvelopeBuilderEx.CreateEnvelope(rec_ll, rec_ur);
    
      //Set symbology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(
        ColorFactory.Instance.BlackRGB, 5.0, SimpleLineStyle.Solid);
      CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(
        ColorFactory.Instance.GreenRGB, SimpleFillStyle.DiagonalCross, outline);
    
    
      GraphicElement recElm = ElementFactory.Instance.CreateGraphicElement(
        layout, rec_env, polySym, "New Rectangle");
      //Or use Predefined shape
      GraphicElement recElm2 = ElementFactory.Instance.CreatePredefinedShapeGraphicElement(
                                layout, PredefinedShape.Rectangle, rec_env, polySym,
                                "New Rectangle2");
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also