Refresh the data of Shapes in Visio drawing with Aspose.Diagram API version 17.6

Share on FacebookTweet about this on TwitterShare on LinkedIn
Aspose.Diagram for .NET logoWe are pleased to announce that the new version 17.6 of Aspose.Diagram API is now live. The new version of the API adds a feature to refresh the data of shapes in the Visio drawing and developers can call this feature after modifying the position or size of shapes in a connected drawing. Please use the following links for downloading Aspose.Diagram for .NET and Java assemblies.

Refresh the data of connected Visio Shapes

The recent version 17.6 of Aspose.Diagram API allows to refresh the data of shapes, including XForm, TextXForm, Connection and Geoms after changing the text or position of the connected shapes. When there are many changes to the ShapeSheet data and developers want to recalculate the connected shapes in a drawing. They can call RefreshData method of each shape instance as below:

C#
// load diagram
Diagram diagram = new Diagram(@"c:\temp\Drawing1.vsdx");
// retrieve page by name
Aspose.Diagram.Page page = diagram.Pages.GetPage("Page-1");
// retrieve shape by ID
Shape shape = page.Shapes.GetShape(12);
shape.RefreshData();
// save diagram
diagram.Save(@"c:\temp\Drawing1.vsdx", SaveFileFormat.VSDX);
Java
// load diagram
Diagram diagram = new Diagram("c:\\temp\\Drawing1.vsdx");
// retrieve page by name
com.aspose.diagram.Page page = diagram.getPages().getPage("Page-1");
// retrieve shape by ID
Shape shape = page.getShapes().getShape(12);
shape.refreshData();
// save diagram
diagram.save("c:\\temp\\Drawing1.vsdx", SaveFileFormat.VSDX);
Besides this, the mechanism of storing and retrieving text elements in the Visio drawings has been improved. The recent version also comprises a series of bug fixes.  In general, it improves export of Visio drawings to SVG and image formats as well as preserves formulas in the shapesheet.

Public API Changes

The following API changes in the new version are also worth noticing:
  • RefreshData() method is added in the Shape class. It helps in recalculating the entire data of the Shape.

Aspose.Diagram for .NET Resources

The following resources will help you work with Aspose.Diagram for .NET: