IWxShape.ConnectionPoints

Syntax

ConnectionPoints(Index: Integer): IGxPointF;

ConnectionPoints[Index: integer]: Prognoz.Platform.Interop.Drawing.IGxPointF;

Parameters

Index. Index of object connection point.

Description

The ConnectionPoints property returns coordinates for object connection points.

Example

Executing the example requires that repository contains a workspace with the WSP identifier containing several connected shapes.

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

Sub UserProc;
Var
    MB: IMetabase;
    ws: IWxWorkspace;
    i: Integer;
    X, Y: Double;
    Shape: IWxShape;
Begin
    MB := MetabaseClass.Active;
    // Get workspace
    ws := MB.ItemById("WSP").Edit As IWxWorkspace;
    Shape := ws.Shapes.Item(0);
    For i := 0 To Shape.ConnectionPointsCount - 1 Do
        X := Shape.ConnectionPoints(i).X;
        Y := Shape.ConnectionPoints(i).Y;
        Debug.WriteLine("X " + X.ToString + #10 + #13 + "Y " + Y.ToString);
    End For;
    // Save changes
    (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;
    i: Integer;
    X, Y: Double;
    Shape: IWxShape;
Begin
    MB := Params.Metabase;
    
// Get workspace
    ws := MB.ItemById["WSP"].Edit() As IWxWorkspace;
    Shape := ws.Shapes.Item[
0];
    
For i := 0 To Shape.ConnectionPointsCount - 1 Do
        X := Shape.ConnectionPoints[i].X;
        Y := Shape.ConnectionPoints[i].Y;
        System.Diagnostics.Debug.WriteLine(
"X " + X.ToString() + char.ConvertFromUtf32(10) + char.ConvertFromUtf32(13) + "Y " + Y.ToString());
    
End For;
    
// Save changes
    (ws As IMetabaseObject).Save();
End Sub;

When executing the example there will be several messages returned, containing coordinates of object connection points.

See also:

IWxShape