new Layer()

Constructor.

Example

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("Layers.vsdx");
// get Visio page
page = diagram.getPages().getPage("Page-1");
// initialize a new Layer class object
layer = new aspose.diagram.Layer();
// set Layer name
layer.getName().setValue("Layer1");
// set Layer Visibility
layer.getVisible().setValue(aspose.diagram.BOOL.TRUE);
// set the color checkbox of Layer
layer.setColorChecked(aspose.diagram.BOOL.TRUE);
// add Layer to the particular page sheet
page.getPageSheet().getLayers().add(layer);
// get shape by ID
shape = page.getShapes().getShape(3);
// assign shape to this new Layer
shape.getLayerMem().getLayerMember().setValue((layer.getIX()).toString());
diagram.save("out-AddLayer.vsdx", aspose.diagram.SaveFileFormat.VSDX);

Methods

getActive()

Specifies whether a layer is active. Shapes that are not preassigned to layers are assigned to the active layer(s) when dropped on the drawing page.

getColor()

The index of the color in the color table used toThe index of the color in the color table used to display the layer or An RGB value specifying a custom color not in the color table (for example, #ff9900 ). display the layer

getColorTrans()

Determines the degree of transparency for a layer or shape's text color, from 0 (completely opaque) to 1 (completely transparent).

getDel()

A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.

getGlue()

Specifies whether shapes belonging to the layer can be glued to.

getIX()

The zero-based index of the element within its parent element.

getLock()

Specifies whether shapes belonging to the layer are locked against being selected or edited.

getName()

Name element specifies the name of a layer.

getNameUniv()

Specifies the universal name of a layer.

getPrint()

Specifies whether shapes belonging to the layer are printed when the drawing is printed.

getSnap()

Specifies whether other shapes can snap to shapes assigned to the layer. Shapes assigned to the layer can snap to other shapes, but other shapes cannot snap to them.

getStatus()

Specifies whether the layer is a valid layer for a document.

getVisible()

Specifies whether shapes belonging to the layer are visible on the drawing page.

isColorChecked()

A flag indicating whether the element has been checked locally. A value of 1 indicates that the element was checked locally. The value of the property is BOOL integer constant.

setColorChecked()

A flag indicating whether the element has been checked locally. A value of 1 indicates that the element was checked locally. The value of the property is BOOL integer constant.

setDel()

A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.

setIX()

The zero-based index of the element within its parent element.