IWxWorkspace.Replace

Fore Syntax

Replace(Shape: IWxShape; ToWxFigureType: WxFigureType): IWxShape;

Fore.NET Syntax

Replace(
        Shape: Prognoz.Platform.Interop.Andy.IWxShape;
        ToWxFigureType: Prognoz.Platform.Interop.Andy.WxFigureType
       ): Prognoz.Platform.Interop.Andy.IWxShape;

Parameters

Shape. The shape, which type must be replaced.

ToWxFigureType. The required shape type.

Description

The Replace method changes type of the shape on the workspace to the specified one.

Comments

To get collection of workspace shapes, use the IWxWorkspace.Shapes property.

Fore Example

Executing the example requires that the repository contains a workspace with the WorkSpace identifier that contains several shapes.

Add links to the Andy, Metabase system assemblies.

Sub Userproc;
Var
    mb: IMetabase;
    Wsp: IWxWorkspace;
    Shape: IWxShape;
Begin
    // Get workspace
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("Workspace").Edit As IWxWorkspace;
    // Get the first workspace shape
    Shape := Wsp.Shapes.Item(0);
    // Change shape type
    Wsp.Replace(Shape, WxFigureType.Ellipse);
    // Save changes
    (Wsp As IMetabaseObject).Save;
End Sub Userproc;

 After executing the example the first workspace shape type is changed.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;
Imports
 Prognoz.Platform.Interop.Andy;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Wsp: IWxWorkspace;
    Shape: IWxShape;
Begin
    // Get workspace
    mb := Params.Metabase;
    wsp := mb.ItemById["Workspace"].Edit() As IWxWorkspace;
    // Get the first workspace shape
    Shape := Wsp.Shapes.Item[0];
    // Change shape type
    Wsp.Replace(Shape, WxFigureType.wftEllipse);
    // Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

See also:

IWxWorkspace