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
 Menu command "Extract Worksheet data ..."
 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

Germany
Posts

Posted - 08/31/2004 :  3:59:45 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5SR4
Operating System: WinXP

Hello, all

is there a programming interface available (OriginC) for the menu command:
"Analysis->Extract Worksheet Data ..." ??

Or any OC function doing the same job?!

Thanks
HAjo

hajo

Germany
Posts

Posted - 09/01/2004 :  2:45:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, All

seams, that nobody knows something about that - it also seams, that there's no programming interface available, scanning the docs and the forums ...

So I want to ask, if someone can explain me, how the function in general works, maybe its easy to write some separate OC code to do the job ...

Thanks
Hajo

Go to Top of Page

easwar

USA
1965 Posts

Posted - 09/01/2004 :  3:03:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hajo,

Our apologies for not responding to this earlier.
Currently this menu item runs internal code, and there is no LabTalk or OC access to this feature.
The dialog can be brought up programmatically from LabTalk using the
domenu 36496
command, but user will then have to fill the condition box in the dialog etc.

We are planning on adding programmatic access in a future version.

That said, one can always write OC code to perform some custom filtering create a new worksheet perhaps?

Easwar
OriginLab


Go to Top of Page

hajo

Germany
Posts

Posted - 09/01/2004 :  3:19:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, easwar

thanks for the answer ...
I know the menu command, but I want programmatically have access to the dialog options as there's no sense in opening and filling in the dialog each time a new file is read in within an analysis cycle of about 100 files ...

can you give any hint, how the internal code Origin is using works?

Is the clipboard used?
Do you copy the entire worksheet and delete the rows that are not
needed?
my favourit would be to sellect a range of data out of a worksheet by a member function like:
wks.getRange(wksTarget, instert_startColumn, insert_startRow, RangeStartRow, RangeEndRow=-1, RangeStartCol=0, RangeEndCol=-1);
(RangeEndCol=-1 for all Columns not emty in worksheet)
or can I do something like that by an other OC function ...

....


Thanks
Hajo

Edited by - hajo on 09/01/2004 3:24:01 PM

Edited by - hajo on 09/01/2004 3:45:29 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 09/01/2004 :  4:22:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Right now, you will need to write your own function. Internally, we first save the worksheet into a template and then load that as destination worksheet. Then starting with this empty worksheet that is identical to the original except the data, we loop each row and call the LT expression to see if TRUE and copy that row.

Your suggestion for a new member function is very good, we will add something like that in Origin 8, maybe

int Worksheet::Extract(Worksheet& wksDest, int nR1, int nC1, int nR2, int nC2, WksFilterBase* pFilter);

If pFilter is NULL, then all the data in the given range will be copied, otherwise this class will have member functions like
virtual BOOL OnBeforeExtract(Worksheet& wksSrc, Worksheet& wksDest, int nR1, int nC1, int nR2, int nC2);
//return TRUE if accept row
virtual BOOL OnExtract(Worksheet& wksSrc, int nRow);

virtual void OnAfterExtract();



CP



Go to Top of Page

hajo

Germany
Posts

Posted - 09/02/2004 :  03:26:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hello, cp

thanks for reply ...
I'll have a look to that at the weekend ...

So far
Hajo


--
Dipl.-Ing. Hans-Joerg Koch
SiemensVDO Automotive,
Regensburg, Germany
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