IWxWorkspace.AutoLinkShapes

Fore Syntax

AutoLinkShapes(Shape1: IWxShape; Shape2: IWxShape): IWxLink;

Fore.NET Syntax

AutoLinkShapes(Shape1: Prognoz.Platform.Interop.Andy.IWxShape, Shape2: Prognoz.Platform.Interop.Andy.IWxShape): Prognoz.Platform.Interop.Andy.IWxLink;

Parameters

Shape1. Workspace shape.

Shape2. Workspace shape that must be connected with the first one.

Description

The AutoLinkShapes method connects two shapes with lines.

Comments

Connecting points for both shapes are selected automatically.

Fore Example

Executing the example requires that repository contains a workspace with the WSP identifier containing at least two shapes.

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

Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Shapes: IWxShapes;
    Link: IWxLink;
    Style: IWxStyle;
Begin
    
// Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById(
"WSP").Edit As IWxWorkspace;
    Shapes := ws.Shapes;
    
// Connect the second shape with the first one
    Link := ws.AutoLinkShapes(Shapes.Item(0), Shapes.Item(1));
    (ws 
As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the connection will be created between two selected shapes.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Shapes: IWxShapes;
    Link: IWxLink;
    Style: IWxStyle;
Begin
    // Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById["WSP"].Edit() As IWxWorkspace;
    Shapes := ws.Shapes;
    // Connect the second shape with the first one
    Link := ws.AutoLinkShapes(Shapes.Item[0], Shapes.Item[1]);
    (ws As IMetabaseObject).Save();
End Sub;

See also:

IWxWorkspace