IWxWorkspace.CreateStraightLink

Syntax

CreateStraightLink: IWxStraightLink;

Description

The CreateStraightLink method creates a connecting line. A connecting line is always strictly vertical or horizontal.

NOTE. If a connecting line creates a link between two objects, each object is provided with a new connection point, which is used by this connecting line.

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;
    StrLink: IWxStraightLink;
    Shapes: IWxShapes;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    ws := mb.ItemById("WSP").Edit As IWxWorkspace;
    // Connect the second shape with the first one
    StrLink := ws.CreateStraightLink;
    Shapes := ws.Shapes;
    ws.GlueConnectionPoints(Shapes.Item(0), 2, StrLink, 0);
    ws.GlueConnectionPoints(Shapes.Item(1), 3, StrLink, 1);
    (ws As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the defined objects are connected with a connecting line.

See also:

IWxWorkspace