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);
Constructor Summary |
---|
Layer()
Constructor. |
Property Getters/Setters Summary | ||
---|---|---|
function | 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. | ||
function | 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 | ||
function | getColorTrans() | |
Determines the degree of transparency for a layer or shape's text color, from 0 (completely opaque) to 1 (completely transparent). | ||
function | getDel() | |
function | setDel(value) | |
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. | ||
function | getGlue() | |
Specifies whether shapes belonging to the layer can be glued to. | ||
function | isColorChecked() | |
function | setColorChecked(value) | |
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. | ||
function | getIX() | |
function | setIX(value) | |
The zero-based index of the element within its parent element. | ||
function | getLock() | |
Specifies whether shapes belonging to the layer are locked against being selected or edited. | ||
function | getName() | |
Name element specifies the name of a layer. | ||
function | getNameUniv() | |
Specifies the universal name of a layer. | ||
function | getPrint() | |
Specifies whether shapes belonging to the layer are printed when the drawing is printed. | ||
function | 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. | ||
function | getStatus() | |
Specifies whether the layer is a valid layer for a document. | ||
function | getVisible() | |
Specifies whether shapes belonging to the layer are visible on the drawing page. |
Constructor Detail |
---|
function Layer()
Property Getters/Setters Detail |
---|
getIX/setIX : Number | |
function getIX() / function setIX(value) |
getDel/setDel : Number | |
function getDel() / function setDel(value) |
getName : Str2Value | |
function getName() |
getColor : ColorValue | |
function getColor() |
isColorChecked/setColorChecked : Number | |
function isColorChecked() / function setColorChecked(value) |
getStatus : BoolValue | |
function getStatus() |
getVisible : BoolValue | |
function getVisible() |
getPrint : BoolValue | |
function getPrint() |
getActive : BoolValue | |
function getActive() |
getLock : BoolValue | |
function getLock() |
getSnap : BoolValue | |
function getSnap() |
getGlue : BoolValue | |
function getGlue() |
getNameUniv : Str2Value | |
function getNameUniv() |
getColorTrans : DoubleValue | |
function getColorTrans() |