LinePenDashPattern: Array;
LinePenDashPattern: System.Array;
The LinePenDashPattern property determines custom line style.
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.
Executing the example requires that repository contains a workspace with the IWSTYLE identifier containing shape.
Add links to the Andy, Drawing, Metabase system assemblies.
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[5] Of 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: