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
 All Forums
 Origin Forum
 Origin Forum
 How to iterate through layers in a script?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hhafezi Posted - 06/25/2001 : 8:12:28 PM
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
1   L A T E S T    R E P L I E S    (Newest First)
rtoomey Posted - 06/26/2001 : 11:45:28 AM

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





The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000