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
 Get dataset from plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jfatherton

USA
3 Posts

Posted - 07/15/2003 :  2:56:05 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Please forgive the stupid question but I am fairly new at OriginC.

I am working on an OriginC function that I want to perform a number of manipulations on a graph that has previously been plotted. Everything was going fine but then I wanted to get data from the datasets that were used to plot the graph. I am probably missing something very simple but, searching through the help files I can find no way to find out which columns of data from which worksheet were used to plot a particular graph. Is this possible?

thanks,

Jeremy

easwar

USA
1965 Posts

Posted - 07/15/2003 :  3:54:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jeremy,

Try the code pasted below - it gets the name of all data plots in the layer. Once you get a data plot name, such as data1_b, you can parse it further to find out which worksheet, which colum etc. If you need further help, please post.

Easwar
OriginLab.


void test()
{
// Delcare graph layer and point to active layer in project
GraphLayer gly = Project.ActiveLayer();
// If valid graph layer, then...
if(gly)
{
printf("List of plots in layer:\n");
// Loop over collection of data plots in
foreach(DataPlot dp in gly.DataPlots)
{
string strName = dp.GetDatasetName();
printf("%s\n", strName);
}
}
// If not valid graph layer, print error
else
printf("Active layer is not a graph layer!\n");
}


Go to Top of Page

jfatherton

USA
3 Posts

Posted - 07/15/2003 :  5:33:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks,

GetDatasetName() was exactly what I was looking for.

Jeremy
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