IWxShape.AddConnectionPoint

Syntax

AddConnectionPoint(Point: IGxPointF): Integer;

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

Parameters

Point. Object connection point.

Description

The AddConnectionPoint method adds an object connection point.

Comments

The coordinates passed by the user are automatically corrected to fit the border of IWxShape.

Example

Executing the example requires that repository contains a workspace with the WSP identifier containing shape.

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(
"WSP").Edit As IWxWorkspace;
    
// Get shape
    Shape := wsp.Shapes.Item(0);
    
// Create point with coordinates
    Point := New GxPointF.Create(1515);
    
// Add a connection point
    Shape.AddConnectionPoint(Point);
    
// 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 point with coordinates
    Point := New GxPointFClass.Create();
    Point.Create(
1515);
    
// Add a connection point
    Shape.AddConnectionPoint(Point);
    
// Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

After executing the example a connection point with set coordinates is added to the shape.

See also:

IWxShape