Skip to main content

Get the connector's destination shape

An example of enumerating the connector's destination shapes displayed on the diagram.

public void EnumerateConnectorPoint(ICommandContext c, ICommandParams p) 
{
IDiagram diagram = c.App.Workspace.CurrentEditor as IDiagram;
if (diagram == null) return;

//Get the displayed connectors
IConnectorCollection connectors = diagram.Connectors;

//Process each connector
foreach (IConnector connector in connectors)
{
c.App.Output.WriteLine("sample", $"Connector shape definition name: {connector.ElementDefinition.DisplayName}");
c.App.Output.WriteLine("sample", $"Model of shape connected to connector start point: {connector.StartPoint.Model.Name}");
c.App.Output.WriteLine("sample", $"Model of shape connected to connector end point: {connector.EndPoint.Model.Name}");
}
}
info

The above sample code uses the following APIs, which have been experimentally implemented.

  • IElementDef.DisplayName property

These APIs are not guaranteed to be of high quality and are not listed in the API specifications. If you use them, you do so at your own risk.