8.1.6.3 DataRange::AddSimple

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

Add a new subrange to the DataRange.

Syntax

Add( pPyWks, R1, C1, R2, C2)

Parameters

pPyWks

Worksheet or MatrixLayer in which range reside

R1

Row range begin

C1

Column range begin

R2

Row range end, use -1 to indicate end of column

C2

Column range end, if only one column then put in same value as nC1, if to end of worksheet use -1

Return

Returns the number of subranges in the DataRange after execution.

Examples

EX1

# Prepare book1 with data in Col(1) and Col(2)
import PyOrigin
data=PyOrigin.NewDataRange()
Sheet=PyOrigin.WorksheetPages('Book1').Layers(0)
if data.IsValid():
    data.AddSimple(Sheet, 0, 0, -1, -1)
gp = PyOrigin.FindGraphLayer('Graph1')
gp.AddPlot(data, 1)