IWxStyle.LinePenDashPattern

Syntax

LinePenDashPattern: Array;

LinePenDashPattern: System.Array;

Description

The LinePenDashPattern property determines custom line style.

Comments

Length of dashes and spaces is determined by using the array of real numbers. Use the IWxStyle.LinePenWxDashStyle property set to WxDashStyle.DashCustom for custom line style.

Example

Executing the example requires that repository contains a workspace with the IWSTYLE identifier containing shape.

Add links to the Andy, Drawing, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Shape: IWxShape;
    SelStyle: IWxStyle;
    s: Array[5Of Double;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
    Shape := ws.Shapes.Item(0);
    // Determine shape formatting parameters
    SelStyle := Shape.Style;
    // Determine line style
    SelStyle.LinePenWxDashStyle := WxDashStyle.DashCustom;
    // Determine line style
    s[0] := 1; s[1] := 2; s[2] := 3; s[3] := 4; s[4] := 5;
    SelStyle.LinePenDashPattern := s;
    // Determine line color and width
    SelStyle.LinePenColor := GxColor.FromName("Green");
    SelStyle.LinePenWidth := 1.5;
    // Save changes
    (ws As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    WSP: IWxWorkspace;
    Shape: IWxShape;
    SelStyle: IWxStyle;
    s: Array[5Of Double;
    GxColorCls: GxColorClassClass = New GxColorClassClass();
Begin
    // Get repository
    MB := Params.Metabase;
    // Get workspace
    WSP := MB.ItemById["IWSTYLE"].Edit() As IWxWorkspace;
    // Get shape
    Shape := WSP.Shapes.Item[0];
    // Determine shape formatting parameters
    SelStyle := Shape.Style;
    // Determine line style
    SelStyle.LinePenWxDashStyle := WxDashStyle.wdsDashCustom;
    // Determine line style
    s[0] := 1; s[1] := 2; s[2] := 3; s[3] := 4; s[4] := 5;
    SelStyle.LinePenDashPattern := s;
    // Determine line color and width
    SelStyle.LinePenColor := GxColorCls.FromName("Green");
    SelStyle.LinePenWidth := 1.5;
    // Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

After executing the example shape line type and style will be changed.

See also:

IWxStyle