DataObject::Formula

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

Get/Set the LabTalk formula and optional Before Formula Script for Column and MatrixObject

Name

Formula

Examples

import PyOrigin
wks=PyOrigin.ActiveLayer()
colA=wks.Columns(0)
colA.SetFormula("5*(i-1)")
colA.ExecuteFormula()

colB = wks.Columns(1)
strExpression = "cos(Amp*x*pi/180)"
strBeforeScript = "double Amp=4.5;" + "\r\n" + "range x=col(A);"
strFormula = strExpression + ";\r\n#" + strBeforeScript
colB.Formula=strFormula
colB.ExecuteFormula()

See Also

GetFormula SetFormula