LinePenDashPattern: 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 the repository contains a workspace with the IWSTYLE identifier that contains a shape.
Add links to the Andy, Drawing, Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Wsp: IWxWorkspace;
Shape: IWxShape;
SelStyle: IWxStyle;
s: Array[5] Of Double;
Begin
// Get workspace for editing
Mb := MetabaseClass.Active;
Wsp := Mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
Shape := Wsp.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
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example shape line type and style will be changed.
See also: