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
 LabTalk Forum
 getpts: data connected to selected point
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

SimpleSimonSays

Germany
6 Posts

Posted - 01/15/2013 :  6:59:38 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.1 SR 2
Operating System: Windows 7 64

Hello everybody! I got some problems with getpts. I have a plot of multiple datasets from different worksheets. I'm trying to build a script that allows my to select some data points from this graph and write them with other data from the selected row to a new worksheet. I didn't manage to get a range on the selected data. I need to know which line in the graph (meaning data from which worksheet) was selected and which row was it.
There ist getpts.data$ but it does not contain, what i was expecting.
Can someone help?

abhishekkhare

Switzerland
4 Posts

Posted - 01/28/2016 :  06:57:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am also looking for the same information, did you figure out something?

Abhi
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 01/29/2016 :  2:46:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi SimpleSimonSays and abhishekkhare,

Does the following snippet help you to understand how getpts can be used?
/////////////////
//Run the getpts command when the graph window is opened
getpts 3;

//Run the following after executing getpts command
type -a Dataset: %(getpts.data$) Index Data: %(getpts.indexdata$) X Data: %(getpts.xdata$);
//XPOS=_XPOS; INDX=_INDX; edit XPOS; edit INDX; 
range xx = [??]!_INDX;  //range of the index loose ds
range ro=[Book2]1!col(1); //destination dataset
ro=xx; //copy loose dataset to a permanent dataset
ds$=getpts.data$;
str1$=Token(ds$,1, '_')$;
str2$=Token(ds$,1, '@')$;
str2$=Token(str2$,2, '_')$;
str3$=Token(ds$,2, '@')$;
type -a Book: %(str1$) Sheet: %(str3$) Column: %(str2$);

//The out put would be like:
Dataset: Book1_B@2 Index Data: _indx X Data: _xpos
Book: Book1 Sheet: 2 Column: B
/////////////////
Note that the 3rd token in getpts.data$ indicates the sheet sequence in the order of the creation.
Also, the following document about getpts has typos of missing '$'s of getpts.xdata$ and getpts.indexdata$ .
http://www.originlab.com/doc/LabTalk/ref/GetPts-cmd#no_option.3B_Get_npts_by_Data_Reader_tool

Hope this helps.

--Hideo Fujii
OriginLab

P.S. You can use the x-function pickpts, which returns the plot name in the range notation. Therefore, we recommend to use pickpts instead of getpts command. See:
http://www.originlab.com/doc/X-Function/ref/pickpts

Edited by - Hideo Fujii on 02/01/2016 2:21:14 PM
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