Refresh shapes data
Contents
[
Hide
]
**Refreshes shape’s position including xform ,connection and geom when changing shape’s text or other’s **
The RefreshData method exposed by the Shape class can be used to refresh shape’s data
The code below shows how to:
- Load a sample file.
- Access a particular shape.
- Refresh shape’s data.
Refresh Shape’s data
Use the following code in your .NET application to refresh a shape using Aspose.Diagram for .NET.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); | |
// Load a Visio diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get page by name | |
Page page = diagram.Pages.GetPage("Page-3"); | |
// Get Shape | |
Shape shape = page.Shapes.GetShape(15); | |
// Refresh data | |
shape.RefreshData(); | |
// Save visio diagram | |
diagram.Save(dataDir + "RefreshData_out.vsdx", SaveFileFormat.VSDX); |