Replace(Shape: IWxShape; ToWxFigureType: WxFigureType): IWxShape;
Shape. The shape, which type must be replaced
ToWxFigureType. The required shape type.
The Replace method changes type of the shape on the workspace to the specified one.
To get collection of workspace shapes, use the IWxWorkspace.Shapes property.
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: