Layer::GetIndex

Description

Get the index of the Layer in the parent page (0 offset). Note: In version 7, the index was based on 1-offset. In versions 7.5 and later, the index is based on 0-offset.

Syntax

int GetIndex( )

Parameters

Return

Index of the layer in the parent page

Examples

EX1

//Get the index of the Layer in the active page(0 offset). 
void Layer_GetIndex_ex1()
{
    // Create a layer object and attach it to currently active layer
    Layer ly = Project.ActiveLayer();
    // If object is valid, get the index and report
    if( ly.IsValid() )
        printf( "Active layer has 0-offset index of %d in the page\n", ly.GetIndex() );
}

Remark

See Also

header to Include

origin.h