MoveConnectionPoint(Index: Integer; Point: IGxPointF);
MoveConnectionPoint(Index: integer; Point: Prognoz.Platform.Interop.Drawing.IGxPointF);
Index. Index of object connection point.
Point. The point, to which object connection point must be placed..
The MoveConnectionPoint method moves object connection point to the specified point.
To get the number of object connection points, use the IWxShape.ConnectionPointCount property.
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;
wsp: IWxWorkspace;
Shape: IWxShape;
Point: IGxpointF;
Begin
//Get workspace for edit
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(100, 100);
// 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;
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["WSP"].Edit() As IWxWorkspace;
// Get shape
Shape := wsp.Shapes.Item[0];
// Create a point with new coordinates
Point := New GxPointF.Create();
Point.Create(100, 100);
// 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;
After executing the example the shape connection point is moved to the point with specified coordinates.
See also: