2.12.2 AddMatrix


Description

Add an matrixobject of the matrixsheet to datarange

Syntax

VB: Function AddMatrix(matrix As MatrixSheet, Index As ByVal Integer ) As Integer
C++: int AddMatrix(MatrixSheet matrix, int Index )
C#: int AddMatrix(MatrixSheet matrix, int Index )

Parameters

Return

Remark

Examples

VB

    Sub AddMatrix()
        Dim app As Origin.ApplicationSI
        Dim dr As Origin.DataRange
        Dim mtx As Origin.MatrixSheet

        app = New Origin.ApplicationSI
        mtx = app.FindMatrixSheet("") 'get active matrixsheet
        If mtx Is Nothing Then
            MsgBox("Can not get an active matrixsheet")
            Exit Sub
        End If

        dr = app.NewDataRange() 'add a project datarange
        dr.AddMatrix(mtx, 0) 'add matrix' first matrixobject to datarange

        Dim data(0 To 9) As Double

        For ii = 0 To 9
            data(ii) = ii + 100
        Next
        dr.SetData(Data)

    End Sub

Version Information

8.0SR2

See Also