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
 selecting and merging two graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

slooff

Netherlands
Posts

Posted - 03/23/2010 :  4:41:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8 and Service Release 6
Operating System:Windows

I have multiple graphs in a project. How can I select two graphs and merge them into one? Both graphs have two layers and the new graph should again have two layers with 2 dataplots in each layer.

Thanks for the help!

Lenneke

Penn

China
644 Posts

Posted - 03/23/2010 :  9:21:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lenneke,

This example can help.

Penn
OriginLab Technical Services
Go to Top of Page

slooff

Netherlands
Posts

Posted - 04/01/2010 :  3:40:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I can plot the graph now, but is there a way to have in the script a dialog box that opens or something like that, so that I can select two graphs in the project (there are many more).
After selcting them I want to use them in the remainder of the script.
Go to Top of Page

Penn

China
644 Posts

Posted - 04/01/2010 :  10:43:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Origin has provided a tool for merging graphs by selecting manually. Maybe you can have a try first. Please refer to this page.

I hope this is what you want.

Penn
OriginLab Technical Services
Go to Top of Page

slooff

Netherlands
Posts

Posted - 04/02/2010 :  02:16:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
No sorry, I need some specific features when I merge the graphs which seem not to be in this merge option.
So I am looking for such a selection dialog that can be opened when I run my script.

Regards,

Lenneke
Go to Top of Page

Penn

China
644 Posts

Posted - 04/02/2010 :  03:45:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lenneke,

Do you mean something like the Graph Browser in the merging graph tool? If so, you can use the following code to bring up this browser for use.

void select_graphs()
{
	string 	strGraphs;
	open_page_preview_list_dlg(GetWindow(), strGraphs);  // bring up the Graph Browser dialog
	printf("The selected graphs:\n%s\n", strGraphs);  // names of the selected graphs
	
	// separate each graph
	vector<string> vsGraphs;
    int nRet = strGraphs.GetTokens( vsGraphs, STR_PAGE_LIST_SEPARATOR);
    if(nRet > 0)
    {
 		for(int iGraph = 0; iGraph<vsGraphs.GetSize(); iGraph++)   	
    		printf("The graph %d is: %s\n", iGraph+1, vsGraphs[iGraph]);
    }
}


Penn
OriginLab Technical Services
Go to Top of Page

slooff

Netherlands
Posts

Posted - 04/02/2010 :  04:47:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, that works!
Thank you!
Go to Top of Page

Belsinga

Netherlands
28 Posts

Posted - 05/21/2010 :  09:07:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What does this

"open_page_preview_list_dlg"

return when you select a graph inside?
Go to Top of Page

Penn

China
644 Posts

Posted - 05/23/2010 :  9:35:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The prototype of this function is:

bool open_page_preview_list_dlg(HWND hWndParent, string& strPages, LPCSTR lpcszStartPEpath = NULL, DWORD dwCtrl = SELECT_MULTIPLE_PAGES | SHOW_FOLDERS | ENABLE_EMBEDED, int nPageType = EXIST_GRAPH, LPCSTR lpcszFilterFuncName = NULL);

When there are graphs selected and the OK button is clicked, it will return true. Otherwise, the Cancel button is clicked and it will return false.

Penn
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