Connector

Connect Shapes Using Connectors

In order to add a connector shape for joining two shapes. Please follow the steps below:

  1. Create an instance of Presentation class.
  2. Obtain the reference of a slide by using its Index.
  3. Add two add AutoShape’s in selected slide using AddAutoShape method exposed by Shapes object.
  4. Add Connector using AddConnector method exposed by Shapes object by defining Connector Type.
  5. Join the added shape using connectors.
  6. Call Reroute() method to create shortest automatic connection path.
  7. Write the Presentation as a PPTX file. In the example given below, we have added a connector between two shapes.

Use Desired Connection Site

In order to add a connector shape for joining two shapes. Please follow the steps below:

  1. Create an instance of Presentation class.
  2. Obtain the reference of a slide by using its Index.
  3. Add two add AutoShape’s in selected slide using AddAutoShape method exposed by Shapes object.
  4. Add Connector using AddConnector method exposed by Shapes object by defining Connector Type.
  5. Join the added shape using connectors.
  6. Setting the desired connection site on shape for connector.
  7. Write the presentation as a PPTX file.

In the example given below, we have added a connector between two shapes.

Find Angle of Connector Lines

In order to calculate the angle for connector line, please follow the steps below:

  1. Create an instance of Presentation class and load the presentation.
  2. Obtain the reference of a slide by using its Index.
  3. Access the Connector Line shape.
  4. Use the line width, height, shape frame height and shape frame width to calculate the angle. In the example given below, we have calculated the angle for connector line shape in slide.