How to get connection point of a line on a shape


I’m currently struggling with how to get where, on a shape, a line is connected to. Say for example I have a rectangle and a line is connected to that rectangle how can I tell whether the line is connected on the top, bottom, left, or right side of the shape.

I’ve found how to set this information with Page.connectShapesWithConnector(), but not how to get this information after it has been set.


Are you working with .NET or Java? If you can share a sample VSDX/VSD file along with the expected output values that you are observing in MS Visio, we will prepare a code sample for you accordingly.


Sorry should have said that in the original post, we are working with Java. With the attached file I was hoping to find the relative ConnectionPointPlace for each line connected to a shape as well as the coordinates that line is attached to on the shape if possible. So for shape ‘1’ I would hope to get back ConnectionPointPlace.Top and some coordinates for where the connection is attached to the shape. and then ConnectionPointPlace.Bottom for shape ‘2’ along with coordinates as well. (45.6 KB)


Diagram d = new Diagram("Visio_Example.vsdx");
Page page = d.getPages().get(0);
Shape shape = page.getShapes().getShape(1);

long[] In_connectedShapeIds = shape.connectedShapes(ConnectedShapesFlags.CONNECTED_SHAPES_INCOMING_NODES, null);
long[] Out_connectedShapeIds = shape.connectedShapes(ConnectedShapesFlags.CONNECTED_SHAPES_OUTGOING_NODES, null);

We currently only support obtaining the link shape ID of the shape, and do not support obtaining a specific connection point. A feature request as been logged as DIAGRAMJAVA-51049 in our issue tracking system for it. We will let you know once its resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as DIAGRAMJAVA-51049) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou