IWxShapes.Count

Syntax

Count: Integer;

Count: integer;

Description

The Count property returns the number of workspace objects.

Example

Executing the example requires that repository contains a workspace with the WSP identifier containing several shapes.

Add links to the Andy, 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;
Imports Prognoz.Platform.Interop.Andy;
 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    view: IWxView;
    Shape: IWxShapes;
    i: Integer;
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    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;

After executing the example all objects located in the workspace are merged into a group.

See also:

IWxShapes