UngroupSelectedShapes;
The UngroupSelectedShapes method ungroups the selected shapes.
Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1.
Add links to the Andy, Drawing, Workspace system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ws: IWxWorkspace;
view: IWxView;
PointF: IGxPointF;
arrow: IWxArrow;
ellipse: IWxEllipse;
Shs: IWxShapes;
i: Integer;
Begin
// Get workspace for editing
ws := UiWorkspace1.WxWorkspace;
view := ws.CreateView;
view := ws.Views.Item(0);
ellipse := ws.CreateEllipse;
arrow := ws.CreateArrow;
Arrow.FirstPoint := New GxPointF.Create(10, 10);
Arrow.LastPoint := New GxPointF.Create(3, 19);
ellipse := ws.CreateEllipse;
Shs := ws.Shapes;
For i := 0 To Shs.Count - 1 Do
view.SelectedShapes.Add(ws.Shapes.Item(i));
End For;
view.GroupSelectedShapes;
view.UngroupSelectedShapes;
End Sub Button1OnClick;
After executing the example the selected groups are ungrouped.
See also: