Add Connection Point To Shape
Contents
[
Hide
]
Add Connection Point To a Shape in Visio
This topic elaborates how developers can add connection point to a visio shape using Aspose.Diagram for .NET.
Add Connection Point
The Connections object represents the connection collection in the Shape class.
The code below shows how to:
- Load a sample diagram.
- get a particular page.
- get a particular shape.
- new a connection
- set the property of connection
- add connection to shape
- save diagram
Add connection point to shape Programming Sample
Use the following code in your .NET application to add connection to a shape using Aspose.Diagram for .NET.
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Shapes();
// Call a Diagram class constructor to load the VSD diagram
Diagram diagram = new Diagram(dataDir + "Drawing1.vsd");
// Get a particular page
Page page = diagram.Pages.GetPage("Page-3");
// Get a dynamic connector type shape by id
Shape shape = page.Shapes.GetShape(18);
// Set dynamic connector appearance
shape.SetConnectorsType(ConnectorsTypeValue.StraightLines);
// Saving Visio diagram
diagram.Save(dataDir + "SetConnectorAppearance_out.vsdx", SaveFileFormat.VSDX);