The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 How to iterate through layers in a script?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hhafezi

USA
1 Posts

Posted - 06/25/2001 :  8:12:28 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have a pretty basic question re scripting. Any examples of iteration through layers would be very helpful too.

I am making graphs containing six different layers on each page. I would like to write a script that will iterate through the layers and add the desired dataplots from a given worksheet. The dataplots are to be plotted as X-Y plots, and do not use the same columns as the X-values.

Thanks,

H. Hafezi

rtoomey

USA
184 Posts

Posted - 06/26/2001 :  11:45:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

Suppose you have a worksheet called "data1" where the columns are organized in this fashion:



A(X1) B(Y1) C(X2) D(Y2) E(X3) F(Y3)



To plot the 3 Y columns into a 3-layer graph called "Graph1", the following script (or something similar) could be used:






layerNum=1; // variable to hold layer number
loop(ii,1,data1!wks.ncols)
{
if(mod(ii,2)==0)
{
win -a data1;
// activate data1
wo -s ii 0 ii 0; // select Y column
%A=%C; // assign dataset name of Y column to %A
win -a graph1; // activate graph1
page.active=layerNum; // activate layer
layer.include(%A,200); // plot selected Y column
layer -a; // rescale layer
layerNum++; // increment layer number variable
}
};




 

Hope that helps!



-rtoomey




Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000