CreateCurveLink: IwxCurveLink;
CreateCurveLink(): Prognoz.Platform.Interop.Andy.IWxCurveLink;
The CreateCurveLink method creates a rounded line in the workspace.
In order the created line becomes rounded, connect it with two points of shape.
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;
CLink: IWxCurveLink;
First, Last: IGxPointF;
Begin
// Get workspace
mb := MetabaseClass.Active;
wsp := mb.ItemById("Workspace").Edit As IWxWorkspace;
// Get shape and coordinates of two points
Shape := wsp.Shapes.Item(0);
If Shape.ConnectionPointsCount >= 2 Then
First := Shape.ConnectionPoints(0);
Last := Shape.ConnectionPoints(1);
// Create a rounded line that connects the first
// and second points
CLink := wsp.CreateCurveLink;
CLink.FirstPoint := First;
CLink.LastPoint := Last;
End If;
//Save changes
(Wsp As IMetabaseObject).Save;
End Sub userproc;
After executing the example a straight line between the first and the second points of object is created. In order the line becomes rounded, connect it to the shape.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Wsp: IWxWorkspace;
Shape: IWxShape;
CLink: IWxCurveLink;
First, Last: GxPointF;
Begin
// Get workspace
mb := Params.Metabase;
wsp := mb.ItemById["Workspace"].Edit() As IWxWorkspace;
// Get shape and coordinates of two points
Shape := wsp.Shapes.Item[0];
If Shape.ConnectionPointsCount >= 2 Then
First := Shape.ConnectionPoints[0];
Last := Shape.ConnectionPoints[1];
// Create a rounded line that connects the first
// and second points
CLink := wsp.CreateCurveLink();
CLink.FirstPoint := First;
CLink.LastPoint := Last;
End If;
//Save changes
(Wsp As IMetabaseObject).Save();
End Sub;
See also: