IWxShapes.RemoveById

Syntax

RemoveById(Id: String): Boolean;

Parameters

Id. Shape identifier.

Description

The RemoveById method removes a shape by identifier and returns whether the removal is successful.

Comments

The method returns False when a shape with identifier, passed with the Id parameter, is missing in the workspace.

Example

Executing the example requires the object of the workspace. Create a form, add the Button1 button to it, the WorkspaceBox component named WorkspaceBox1,nbsp;the UiWorkspaceObject component named UiWorkspaceObject1, define the workspace as an object of the UiWorkspaceObject1 component, the UiWorkspaceObject1 component as the source of the WorkspaceBox1 component, and set the True value for the Active property of the UiWorkspaceObject1 component. The workspace contains a shape with the Shape54 identifier.

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

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
    text := WorkspaceBox1.View.Workspace.Shapes.RemoveById("Shape54").ToString;
End Sub Button1OnClick;

On clicking the Button1 button, the shape with the Shape54 identifier is removed from the WorkspaceBox component area and the removal result is shown in the window header text.

See also:

IWxShapes