2.1.6.2 DataRange::AddMatrix


Description

Add an matrixobject of the matrixsheet to datarange

Syntax

AddMatrix(Matrix, Index = 0)

Parameters

Matrix
Origin Matrix sheet
Index
Sheet index

Return

Returns the number of matrixsheet in the matrixbook after execution.

Examples

EX1

#prepare a matrixbook Mbook1 and a Graph Graph1 for test
import PyOrigin
data=PyOrigin.NewDataRange()
pArr2D = [[x for x in range(32)] for x in range(32)] 
MatrixPage=PyOrigin.MatrixPages('MBook1')
MatrixPage.Layers('MSheet1').MatrixObjects(0).SetData(pArr2D, 0, 0)
data.AddMatrix(MatrixPage.Layers('MSheet1'))
gp = PyOrigin.FindGraphLayer('Graph1')
gp.AddPlot(data, 226)