2.2.4.46.77 Worksheet::SetEvenSampling

Description

Many operations in Origin, like plotting and some analysis routines can run faster if a column is set to be evenly spaced. Set a column or all columns in worksheet to be evenly spaced so there is no to use X column

Syntax

int SetEvenSampling( double x0, double xInc, Column & cc = NULL, LPCSTR lpcszXUnits = NULL, LPCSTR lpcszXLongName = NULL, BOOL bUndo = FALSE )

Parameters

x0
[input] X value of first row
xInc
[input] X increment between each row
cc
[input] if NULL, set all columns, otherwise set only the specified column
lpcszXUnits
[input] if not NULL, will set as X unit. default is NULL.
lpcszXLongName
[input] if not NULL, will set as X long name. default is NULL.
bUndo
[input] undo

Return

0 for success

if cc is not set, then all cols in wks is set to same.

If cc is not set and wks has ANY X col, returns -1

if cc is set and it has X to the left, returns -2

Examples

EX1

//Set even sampling in the active worksheet.
void Worksheet_SetEvenSampling_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if( wks )
    {
        foreach(Column cc in wks.Columns)
        {
            int nRet = wks.SetEvenSampling(10, 1, cc);
        }
    }
}

Remark

See Also

Header to Include

origin.h