2.25.10 GetData


Description

Get data as 2D array from an Origin Matrix Object

Syntax

VB:

Function GetData([ nRowStart As ByVal Object ], [ nColStart As ByVal Object ], [ nRowEnd As ByVal Object ], [ nColEnd As ByVal Object ], [ format As ByVal Object ], [ lowbound As ByVal Object ] ) As Object

C++:

_variant_t GetData(_variant_t nRowStart, _variant_t nColStart, _variant_t nRowEnd, _variant_t nColEnd, _variant_t format, _variant_t lowbound )

C#:

var GetData(var nRowStart, var nColStart, var nRowEnd, var nColEnd, var format, var lowbound )

Python:

Minimum Origin Version Required: 2018 SR0

def GetData(self, nRowStart=0, nColStart=0, nRowEnd=-1, nColEnd=-1, format=ARRAY2D_NUMERIC, lowbound=-1):

Parameters

nRowStart
use 0 to start from the beginning
nColStart
use 0 to start from the 1st column
nRowEnd
use -1 to indicate last row, or a 0-offset row index as the last row to get
nColEnd
use -1 to indicate last column, or a 0-offset column index as the last column to get
format
--
lowbound
0 for C/C++, LabVIEW, 1 for Excel VBA, this is the index for the first element in an array.

Return

Remark

Examples

VBA

to get active matrix window values to Excel sheet

    Dim app As Origin.Application
    Dim msht As Origin.MatrixSheet
    Dim mo As Origin.MatrixObject
    
    Set app = New Origin.ApplicationSI
    Set msht = app.FindMatrixSheet("")
    If msht Is Nothing Then
        MsgBox "No active matrix book found"
        Exit Sub
    End If
    Set mo = msht.MatrixObjects(0)
    
    Dim data As Variant
    
    data = mo.GetData(0, 0, -1, -1, ARRAY2D_NUMERIC, 1)

    Dim ii As Integer
    Dim jj As Integer
    
    'fill excel sheet with matrix values
    For ii = 1 To msht.Cols
      For jj = 1 To msht.Rows
         Cells(jj, ii) = data(ii, jj)
      Next jj
    Next ii

Version Information

8.0SR2

See Also

SetData