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 repository contains a workspace with the WSP identifier containing 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("WSP").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 rounded line that connects the first
// and the second point
CLink := wsp.CreateCurveLink;
CLink.FirstPoint := First;
CLink.LastPoint := Last;
End If;
//Save changes
(Wsp 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;
Wsp: IWxWorkspace;
Shape: IWxShape;
CLink: IWxCurveLink;
First, Last: GxPointF;
Begin
// Get workspace
mb := Params.Metabase;
wsp := mb.ItemById["WSP"].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 rounded line that connects the first and the second point
CLink := wsp.CreateCurveLink();
CLink.FirstPoint := First;
CLink.LastPoint := Last;
End If;
//Save changes
(Wsp As IMetabaseObject).Save();
End Sub;
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.
See also: