IWxWorkspace.CreateRegulargon

Syntax

CreateRegulargon: IWxRegulargon;

CreateRegulargon(): Prognoz.Platform.Interop.Andy.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;
Begin
    // Get workspace
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
    Reg := wsp.CreateRegulargon;
    Reg.Id := "Reg1";
    Reg.PinPosition := New GxPointF.Create(122);
    Reg.NumberOfSides := 5;
    Reg.Text := "Trapezoid";
    //Save changes
    (Wsp 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;
    Reg: IWxRegulargon;
Begin
    
// Get workspace
    mb := Params.Metabase;
    wsp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    Reg := wsp.CreateRegulargon();
    Reg.Id := 
"Reg1";
    Reg.PinPosition.Create(
122);
    Reg.NumberOfSides := 
5;
    Reg.Text := 
"Trapezoid";
    
//Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

Executing this example will create a trapezium in a workspace.

See also:

IWxWorkspace