IWxWorkspace.AutoLinkShapes

Syntax

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

Parameters

Shape1. The first 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.

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;
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.

See also:

IWxWorkspace