IWxWorkspace.CreateRegulargon

Syntax

CreateRegulargon: IWxRegulargon;

Description

The CreateRegulargon method creates a polygon.

Example

Executing the example requires that repository contains a workspace with the WSP identifier.

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

Sub Userproc;
Var
    Mb: IMetabase;
    Wsp: IWxWorkspace;
    Reg: IWxRegulargon;
    Style: IWxStyle;
Begin
    // Get workspace
    Mb := MetabaseClass.Active;
    Wsp := Mb.ItemById("WSP").Edit As IWxWorkspace;
    // Create a polygon
    Reg := Wsp.CreateRegulargon;
    // Specify shape identifier
    Reg.Id := "Reg1";
    // Set shape position coordinates
    Reg.PinPosition := New GxPointF.Create(122);
    // Specify number of shape sides
    Reg.NumberOfSides := 5;
    // Set up displaying of shape name
    Reg.Text := "Pentagon";
    Style := Reg.Style;
    Style.TextFontSize := 6;
    // Save changes
    (Wsp As IMetabaseObject).Save;
End Sub Userproc;

After executing the example a pentagon with the specified text is created in the workspace.

See also:

IWxWorkspace