8.1.21.19 OriginObject::SetIndex

It is recommended that you switch to the originpro package. PyOrigin is primarily for users who need to work with Origin version prior to 2021.


Description

Set the index of an object in a Collection

Syntax

SetIndex(nIndex)

Parameters

nIndex
the index of an object in a Collection

Return

None

Examples

EX1

import PyOrigin
#Create a new workbook with 3 sheets
wkPage = PyOrigin.ActivePage()
wksLayer3 = wkPage.Layers(2)
wksLayer3.SetIndex(0)   #Set the third sheet to be first
nIndex = wksLayer3.GetIndex()
assert(nIndex == 1), 'Index setting failed'

See Also

GetIndex