Count: Integer;
The Count property returns the number of workspace objects.
Executing the example requires that the repository contains a workspace with the WSP identifier that contains several shapes.
Add links to the Andy and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Wsp: IWxWorkspace;
View: IWxView;
Shape: IWxShapes;
i: Integer;
Begin
// Get workspace for editing
Mb := MetabaseClass.Active;
Wsp := Mb.ItemById("WSP").Edit As IWxWorkspace;
View := Wsp.CreateView;
Shape := Wsp.Shapes;
For i := 0 To Shape.Count - 1 Do
View.SelectedShapes.Add(wsp.Shapes.Item(i));
End For;
View.GroupSelectedShapes;
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example all objects located in the workspace are merged into a group.
See also: