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 for Programming
 LabTalk Forum
 RE: Origin Macros

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
jprank2 Posted - 06/28/2006 : 4:40:16 PM
Origin Version (Select Help-->About Origin):
Operating System:Windows XP

I was wondering if anyone could tell me where I might learn how to write macros in LabTalk in order to use them in Origin. I have looked at a few resources but I am not sure how to start. I have programming experience, but I just don't understand how to go about structuring a script for a macro and what to put with the script (button picture, etc) in order to make it work. On top of that, I'd like to be able to find a resource that might already have examples of things/ operations that I might want to do in my macros.
I appreciate your time.
2   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 07/05/2006 : 2:19:36 PM
You can see the list of Origin pre-defined macros by opening the script window and typing
list -m<Enter>
You can list any of these pre-defined macros by using its name as follows (shown for ARRANGELAYERS macro) :
def ARRANGELAYERS<Enter>
which will output the full script :
{


x = 100 - Left - Right - (%2-1)*xGap;
x/=%2;
y = 100 - Top - Bottom - (%1-1)*yGap;
y/=%1;
if(x < 5 || y < 5) {
ty -b $General.SmallLayer;
break 1;
};
k = 0;
for(i = 1; i <= %1; i+=1) {
for(j = 1; j <= %2; j+=1) {
for(k+=1;k <=page.nlayers;k+=1) {
#!k=;
layer -s k;
if(layer.link == 0 || layer.unit != 7) break;
};
layer -u 1;
if(%2==1) {
layer x y [Left+(j-1)*(x + xGap)] [Top+(%1 - i)*(y + yGap)];
}
else {
layer x y [Left+(j-1)*(x + xGap)] [Top+(i-1)*(y + yGap)];
};
}
};

}

Note that %1, %2 etc. are the placeholders for the arguments passed to the macro. You can have up to 5 arguments.

Deanna Posted - 07/02/2006 : 9:57:15 PM
To define a macro, just use

define macroName;



More infomaiton and examples are available in the help file: LabTalk.chm. Typically, it locates in the subfolder
\Help
in the folder where your Origin program is installed.

I hope it will be able to help.

Deanna
OriginLab GZ Office

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