Working with Layers

Configure Shape Objects with Layers in Visio

Aspose.Diagram for .NET allows to configure shape objects with layers in Microsoft Office Visio diagram. Each shape can belong to multiple layers so developers can manage shapes to suit end user needs. The Shape class object offers LayerMember property which allows to add and remove shape objects to and from the layers in Visio drawing. Users can manage these properties programmatically using Aspose.Diagram API as follows:

Configure Shape Objects Programming Sample

The following piece of code helps to add, remove and move shape object properties.

Add a new Layer in the Visio Diagram

Aspose.Diagram for .NET allows developers to add new layers to organize custom categories of shapes, and then assign shapes to those layers programmatically. The LayerCollection class offers Add method which allows to add a new Layer in the Visio drawing. Developers can set Layer properties by initializing its class object.

Add Layer Programming Sample

The following piece of code helps to add Layer objects.

Retrieve All Layers from the Visio Diagram

Aspose.Diagram for .NET gives access to developers to get the existing layers of a Visio diagram. The PageSheet property of the Page class allows to retrieve the list of available layers from a Visio diagram using LayerCollection class.

Retrieve Layers Programming Sample

The following piece of code helps to get the list of Layers.