How to make a cartographic line symbol

This article shows the necessary steps to create a dashed cartographic line symbol.

Making a cartographic line symbol

Cartographic line symbols allow you to create either solid, unbroken lines or lines that consist of a series of marks and gaps to create a variety of dashed symbols. The Cap property is used to control the appearance of start and end nodes. The Join property can control how line bends display.
The following code shows the creation of a dashed line symbol that consists of a long dash followed by three short dashes (dots):
static void cartographicLineSymbol()throws Exception{
    // Make a new Cartographic Line symbol and sets its properties
    ICartographicLineSymbol cartographicLineSymbolCls = new CartographicLineSymbol();

    // In order to set additional properties like offsets and dash patterns we must create an ILineProperties object
    ILineProperties lineProperties = ((ILineProperties)(cartographicLineSymbolCls));

    // Here's how to do a template for the pattern of marks and gaps
    double pttrn[] = {
        0, 7, 1, 1, 1, 0

    ITemplate templateCls = new Template();

    // Add the mark/gap patterns into the Template
    int jx = 0;
    for (int ix = 1; ix <= 3; ix++){
        templateCls.addPatternElement(pttrn[jx], pttrn[jx + 1]);
        jx = jx + 2;


    //Set the cartographic line properties

    // Make the line red
    IRgbColor rgbColorCls = new RgbColor();

See Also:

How to make a character marker symbol
How to make a gradient fill symbol
How to make a line callout
How to make a line fill symbol
How to make a picture marker symbol
How to make different types of colors

Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine