OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

op_change

Contents

Brief Information

Get and set tree stored in operation object

Additional Information

This X-Function not designed for Auto GetN Dialog.

Minimum Origin Version Required: 8.1 SR2

Command Line Usage

  1. op_change ir:=FitNL1! tr:=mytr;
  2. op_change ir:=col(2) tr:=mytr op:=run;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
ir

Input

Range

<optional>
Specifies the range that contains operation. This X-Function gets treenodes from or triggers the recalculation using settings specified in treenodes in this range.
tr

Input/Output

TreeNode

<none>
Specifies the tree name to get or set operation settings.
op

Input

int

0
Specified the operation performed on the tree node

Option list:

  • get:Get Tree
    Gets settings from input operation object and store them in tree node
  • run:Set and Execute
    Sets and executes the operation settings stored in tree node
  • set:Set Tree Only
    Sets operation settings to tree node only
result

Output

int

<unassigned>
Shows whether the execution succeeds or not. If result = 1, execution succeeds. If result = 0 or -1, execution fails.

Description

After getting results from an operation, which allows recalculation, it is usually wanted to access to the operation settings and change some of them to trigger recalculation programmatically. This X-Function allows you to get the operation settings from input object and store them into a user-defined tree. You can also reset the settings and execute the operation again. It is especially useful when you load an Analysis Template and want to change some settings for new data analysis.

Examples

The following scripts just show you a brief example to get and reset smooth settings by using op_change.

newbook;
col(1)={1:32};
col(2)=col(1)+rnd();
col(3)=col(1)+3*rnd();
worksheet -s 2 0;
smooth -r 2;
op_change ir:=col(4) tr:=mytree; //get smooth settings to mytree
mytree.xfGetN.iy.Range1.Y$="[%H]Sheet1!C";
mytree.xfGetN.npts=10; 
op_change ir:=col(4) tr:=mytree op:=run; //recalculate smoothing by using col(3) as input and npts=10