IWxWorkspace.CreateView

Syntax

CreateView: IWxView;

CreateView(): Prognoz.Platform.Interop.Andy.IWxView;

Description

The CreateView method creates a workspace view.

Example

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

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

Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    view: IWxView;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById("WSP").Edit As IWxWorkspace;
    view := ws.CreateView;
    view.Id := "MyView";
    view.Scale := 0.5;
    view.Size := New GxSizeF.Create(100.55,100.66);
    view.Offset := New GxPointF.Create(103);
    (ws As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    view: IWxView;
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    view := ws.CreateView();
    view.Id := 
"MyView";
    view.Scale := 
0.5;
    view.Size.Create(
100.55,100.66);
    view.Offset.Create(
103);
    (ws 
As IMetabaseObject).Save();
End Sub;

After executing the example a workspace view is created and its identifier, scale, size and center offset are set.

See also:

IWxWorkspace