Group Multiple Shapes Together in the Visio Drawing
Aspose.Diagram API allows developers in grouping shapes together to move them all at once. Each shape in a group maintains a unique identity and has its own set of properties. When we change the formatting of a group of shapes, it assigns the new property to each shape.
How to Group Shapes
Group method exposed by the ShapeCollection class can be used to group shapes together.
The code below shows how to:
- Load a sample diagram.
- initialized an array of the shapes
- get a particular shape by id.
- get another particular particular shape by id.
- assign shapes to the array.
- group shapes by calling the
- save diagram
Group Shapes Programming Sample
Use the following code in your .NET application to group shapes together using Aspose.Diagram for .NET API.
Convert a Visio Shape to Other File Formats
Aspose.Diagram for .NET API allows developers to convert a single Visio shape to any other supported file format. In this article, we remove all other Visio shapes from the page and customize page setting according to the source Shape size.
Converting a Particular Visio Shape
Developers can convert a Visio shape to PDF, HTML, Image, SVG, and SWF by specifying the Visio save options.
This example code work as follows:
- Load a source Visio.
- Get a particular page.
- Remove the background page.
- Build a hash table of all shapes holding the ids and names.
- Iterate through the hash table
- Remove all shapes from the Visio page, except the particular one.
- Set the page size.
- Save the Visio page in any supported file format.
Convert Shape Programming Sample
Convert Visio Shape to PDF
Convert Visio Shape to HTML
Verify Whether Two Visio Shapes are Connected or Glued
Aspose.Diagram for .NET API allows developers to verify that the two Visio shapes are glued or connected. Previously, we have seen that how we can connect or glue two shapes in these help topics: Add and Connect Visio Shapes and Glue Shapes Inside the Container.
Verification of the Connected or Glued Shapes
The Shape class offers
IsConnected properties to determine whether two shapes are glued or connected.
Verification of Connected or Glued Shapes Programming Sample
The following piece of code verifies whether two shapes are connected or glued.
Verify Whether the Visio Shape is in a Group of Shapes
Aspose.Diagram for .NET API allows developers to verify that the Visio shape is in a group of shapes or not.
Verification of Shape in the Group of Shapes
The Shape class offers
IsInGroup properties to determine whether the Visio shape is in a group shape.
Verification of Shape in the Group of Shapes Programming Sample
The following piece of code verifies whether the shape is in a group shape.