Get data as 2D array from an Origin Matrix Object
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):
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
8.0SR2