IWxShape.MoveConnectionPoint

Fore Syntax

MoveConnectionPoint(Index: Integer; Point: IGxPointF);

Fore.NET Syntax

MoveConnectionPoint(Index: integer; Point: Prognoz.Platform.Interop.Drawing.IGxPointF);

Parameters

Index. Index of object connection point.

Point. The point, to which object connection point must be placed..

Description

The MoveConnectionPoint method moves object connection point to the specified point.

Comments

To get the number of object connection points, use the IWxShape.ConnectionPointCount property.

Fore Example

Executing the example requires that the repository contains a workspace with the WorkSpace identifier that contains several shapes.

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

Sub UserProc;
Var
    mb: Imetabase;
    wsp: IWxWorkspace;
    Shape: IWxShape;
    Point: IGxpointF;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("Workspace").Edit As IWxWorkspace;
    // Get shape
    Shape := wsp.Shapes.Item(0);
    // Create a point with new coordinates
    Point := New GxPointF.Create(100100);
    // Assign the specified coordinates to the last added point provided
    // that the number of points is not equal to 0
    If Shape.ConnectionPointsCount <> 0 Then
        Shape.MoveConnectionPoint(Shape.ConnectionPointsCount - 1, Point);
    End If;
    // Save changes
    (Wsp As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the shape connection point is moved to the point with specified coordinates.   

Fore.NET Example

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

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

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Shape: IWxShape;
    Point: GxPointF;
Begin
    // Get workspace for editing
    mb := Params.Metabase;
    wsp := mb.ItemById["Workspace"].Edit() As IWxWorkspace;
    // Get shape
    Shape := wsp.Shapes.Item[0];
    // Create a point with new coordinates
    Point := New GxPointF.Create();
    Point.Create(100100);
    // Assign the specified coordinates to the last added point provided
    // that the number of points is not equal to 0
    If Shape.ConnectionPointsCount <> 0 Then
        Shape.MoveConnectionPoint(Shape.ConnectionPointsCount - 1, Point);
    End If;
    // Save changes
    (Wsp As IMetabaseObject).Save();
    End Sub;

See also:

IWxShape