AddConnectionPoint(Point: IGxPointF): Integer;
AddConnectionPoint(Point: Prognoz.Platform.Interop.Drawing.IGxPointF): integer;
Point. Object connection point.
The AddConnectionPoint method adds an object connection point.
The coordinates passed by the user are automatically corrected to fit the border of IWxShape.
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 coordinates
Point := New GxPointF.Create(15, 15);
// Add a connection point
Shape.AddConnectionPoint(Point);
// Save changes
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a connection point with set coordinates is added to the shape.
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 coordinates
Point := New GxPointFClass.Create();
Point.Create(15, 15);
// Add a connection point
Shape.AddConnectionPoint(Point);
// Save changes
(Wsp As IMetabaseObject).Save();
End Sub;
See also: