ConnectedShapes(ConnectionPointIndex: Integer; ConnectedCPShapeIndex: Integer): IWxShape;
ConnectionPointIndex. Index of source object connection point (shown as a red point on the image)
ConnectedCPShapeIndex. Index of the shape linked to the object in ConnectionPointIndex (the figure shows two such shapes: A and B).
The ConnectedShapes property enables the user to get a shape connected with the source object in the defined point.
Connection point indexes of a source object are displayed in black, connection point indexes of shapes, connected with an object in the ConnectionPointIndex point displayed in red, are displayed in blue and green:
There are two shapes, connected with the object in this point: A and B. The property returns A or B shapes.
Executing the example requires that repository contains a workspace with the WSP identifier containing several connected shapes containing text.
Add links to the Andy, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
ws: IWxWorkspace;
i, j: Integer;
Shape, CSh: IWxShape;
Begin
MB := MetabaseClass.Active;
// Get workspace
ws := MB.ItemById("WSP").Edit As IWxWorkspace;
Shape := ws.Shapes.Item(0);
For i := 0 To Shape.ConnectionPointsCount - 1 Do
If Shape.ConnectedCpShapesCount(i) > 0 Then
For j := 0 To Shape.ConnectedCpShapesCount(i) - 1 Do
CSh := Shape.ConnectedShapes(i, j);
Debug.WriteLine(CSh.Text);
End For;
End If;
End For;
// Save changes
(ws As IMetabaseObject).Save;
End Sub UserProc;
When executing the example there will be several messages returned, containing text of shapes, connected with the original object.
See also: