Connector. Shape

Tell me I would like to take the data from the document and re-save it with the connectors, but how do I (connect) the shapes, as they were originally. Does the shape store information, how and with whom is it connected? When creating a connector, we will specify these source.zip (17.2 KB)
data (up, down, left, right) for both figures. Thank you

@shapik,

You can connect Visio shapes and also verify that whether they are connected or not. Please refer to these help topics: Add and Connect Visio Shapes and Verify Whether Two Visio Shapes are Connected or Glued

At the moment,to save the connector in the form in which I took it from the diagram, I do:

  1. I define 2 shapes on the diagram, which I need to connect.
  2. Using the ConnectShapesViaConnector function (point out: up, bottom, left, right) and the connector itself. But the connector is drawn crookedly, until you move or resize the shape to which the connector is attached.
    Question 1: how do I know where the connector to the shapes was fastened to?
    Question 2: what data do I need to save, to repair the connector with its corners and view in the new document and how exactly should I connect in this case? Thanks for the quick answers)

@shapik,

Kindly send all details of the scenario, including source drawing, stencil file (if any) and the complete code. We will investigate your scenario in our environment, and share our findings with you.

ConnectedShapes method of the Shape instance helps to retrieve the incoming and outgoing connecting lines. We need to set ConnectedShapesFlags as follows:
C#

long[] In_connectedShapeIds = shape.ConnectedShapes(ConnectedShapesFlags.ConnectedShapesIncomingNodes, null); 
long[] Out_connectedShapeIds = shape.ConnectedShapes(ConnectedShapesFlags.ConnectedShapesOutgoingNodes, null);

Please refer to this help topic: Get the Shapes Connected to a Particular Shape

how to determine how the form was connected to which connector (in which place) in the shape. Where is this information stored in the shape?
I need these data so that I can connect the shapes correctly in the new drawing. Thank you

@shapik,
In case of the connector shape instance, you can call Shape.GluedShapes method because it will return a list of connected shape Ids. These shape Ids could be of 1D or 2D shapes. We can get the shape from the ShapeCollection instance by its Id. You need to apply a filter through the parameter as follows:
C#

    //load diagram
    Diagram diagram = new Diagram("C:/ temp / Base.vsd");
    // get connector shape object
    Shape connector = diagram.Pages[0].Shapes[4];
    // get list of shape ids
    long[] shapes = connector.gluedShapes(GluedShapesFlags.GluedShapesAll2D, null, null); 

Please refer to this help topic: Get the Connectors Glued to a Particular Shape

I am looking at accessing ConnectCollection on a shape instead of accessing it on the page in .NET. It appears that in Java you can get access to ConnectsCollections on the shape. ConnectCollection | Aspose.Diagram for Java API Reference

In .NET I can only access Connections, not a Connects object. I am trying to iterate through the shapes on the page and get information about what it is connected to and information like “ToSheet” and “ToCell”. However that information is only available on the Connects object, not the Connection object.

Can this be added or should I simply create my own hash table to reference to get the information that I want?

@susanktuvell

We are looking into it and will share our feedback with you soon.

1 Like

@susanktuvell

Thanks for your inquiry.

The ToCell and ToSheet methods are currently available at Page level and in order to get connected shapes information, you may please use Shape.ConnectedShapes() method. We have logged a feature request as DIAGRAMNET-51603 in our issue tracking system for your original requirements and as soon as we have some definite updates regarding logged ticket, we will share with you. Please spare us little time.

We are sorry for the inconvenience.

Hi!
Yes this looks like it could work. I cannot seem to find the definition for “catagoryString” the second parameter in this method. Can you give me an example?

@susanktuvell

The second parameter is for filtering the shapes on the basis of their category. You may pass this parameter as null in order to retrieve all connected shapes. For example, please check below code snippet to determine incoming and outgoing nodes for a shape:

page.Shapes[1].ConnectedShapes(Diagram.ConnectedShapesFlags.ConnectedShapesAllNodes, null);