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 for Programming
 Forum for Origin C
 Access of Menubar Commands
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hajo_old

Germany
141 Posts

Posted - 02/27/2003 :  10:13:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, all

I yust want to ask if it is possible to directly invoke menu commands within OriginC or LabTalk?

In special I want to call the menu command:
"Analysis" -> "Average Multiple Curves"
within an OriginC function.

How can I do this? Whats the function called, that performs the task?

Thanks
Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1

Mike Buess

USA
3037 Posts

Posted - 02/27/2003 :  10:42:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hajo,

You can find out what a menu command does as follows.

1> Open script window.
2> Press <Ctrl>+<Shift> and select the menu item you're interested in.
3> The menu ID for that command shows up in the script window.
4> Additionally, if the command launches a LabTalk script then the relevant run.section() command shows up in the script window and the scrift file opens to that section in CodeBuilder.

When I tried that with Analysis -> Average Multiple Curves I saw the following in the script window...

Menu id=34160
run.section(GRANALY,AveCurves)

So there are two methods you can use to run that menu command from LabTalk (or OriginC with LT_execute).

1> menu -e 34160; // run the command with the given menuID.
2> run.section(GRANALY,AveCurves); // run the script section

Note that menuIDs can change from one Origin version to the next, so method 2 is more reliable.

Mike Buess
Origin WebRing Member
Go to Top of Page

hajo_old

Germany
141 Posts

Posted - 02/27/2003 :  10:50:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike

is that feature somewhere documented?

Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/27/2003 :  11:26:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's mentioned under the "menu" command description in the LabTalk programming guide. (Look for the "-e ID" option.) The feature has been around at least since Origin 5.0, probably longer.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/27/2003 12:20:31 PM
Go to Top of Page

CoMic

Germany
4 Posts

Posted - 03/08/2024 :  05:32:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is a review of a very old topic.
Currently, when using CTRL+SHIFT, the XFunction Code Builder opens up. So the oldfashioned approach no longer works, which is a pity.

What I am to do with the cope snippet that appears is totally unclear and as to my search completely undocumented.

The functionality I am looking for is to have a scripting command that does calculations and outputs result sheets just the same way as manual calling the menu would do.

DLR-VE
Go to Top of Page

jasmine_chan

China
Posts

Posted - 03/26/2024 :  06:24:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, you can open the X-Function dialog(not code builder), then click the top-right triangle button. Choose Generate Script at the menu bottom so that you can run the script in LT to do the same thing.

see details on
https://www.originlab.com/doc/LabTalk/Tutorials/Tutorial-XF#Generate_Script_from_X-Function_Dialog

quote:
Originally posted by CoMic

This is a review of a very old topic.
Currently, when using CTRL+SHIFT, the XFunction Code Builder opens up. So the oldfashioned approach no longer works, which is a pity.

What I am to do with the cope snippet that appears is totally unclear and as to my search completely undocumented.

The functionality I am looking for is to have a scripting command that does calculations and outputs result sheets just the same way as manual calling the menu would do.

DLR-VE


Edited by - jasmine_chan on 03/26/2024 06:26:08 AM
Go to Top of Page

CoMic

Germany
4 Posts

Posted - 04/03/2024 :  10:49:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jasmine
thank you for your reply. I tried it out on several functions and some work like charm (e.g. grubbs, freqcounts), whereas others throw an 'X-Function not supported'-error (e.g. OneSampleTtest), at least on my system. Why some work and others don't is not obvious to me.
KR
Michael

DLR-VE
Go to Top of Page

jasmine_chan

China
Posts

Posted - 04/06/2024 :  11:06:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Indeed some XFs are designed as script-not-accessible, so Generate Script is not applicable....in such case, you can search OneSampleTtest on https://www.originlab.com/doc
You will find ttest1 can be called by script https://www.originlab.com/doc/en/X-Function/ref/ttest1


quote:
Originally posted by CoMic

Hi Jasmine
thank you for your reply. I tried it out on several functions and some work like charm (e.g. grubbs, freqcounts), whereas others throw an 'X-Function not supported'-error (e.g. OneSampleTtest), at least on my system. Why some work and others don't is not obvious to me.
KR
Michael

DLR-VE

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