IWxWorkspace.CreateLink

Syntax

CreateLink: IWxLink;

CreateLink(): Prognoz.Platform.Interop.Andy.IWxLink;

Description

The CreateLink method creates a broken 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;
    wsp: IWxWorkspace;
    Link: IWxLink;
    Shapes: IWxShapes;
Begin
    // Get workspace
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
    // Get shape
    Link := wsp.CreateLink;
    Shapes := wsp.Shapes;
    Link.FirstPoint := Shapes.Item(0).ConnectionPoints(0);
    Link.LastPoint := Shapes.Item(1).ConnectionPoints(0);
    //Save changes
    (Wsp 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;
    wsp: IWxWorkspace;
    Link: IWxLink;
    Shapes: IWxShapes;
Begin
    
// Get workspace
    mb := Params.Metabase;
    wsp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    
// Get shape
    Link := wsp.CreateLink();
    Shapes := wsp.Shapes;
    Link.FirstPoint := Shapes.Item[
0].ConnectionPoints[0];
    Link.LastPoint := Shapes.Item[
1].ConnectionPoints[0];
    
//Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

After executing the example a link between two objects is created.

See also:

IWxWorkspace