IWxWorkspace.Replace

Syntax

Replace(Shape: IWxShape; ToWxFigureType: WxFigureType): 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.

Example

Executing the example requires that the repository contains a workspace with the WSP 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("WSP").Edit As IWxWorkspace;
    // Get the first shape on workspace
    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.

See also:

IWxWorkspace