Author |
Topic |
|
bbjjbb
7 Posts |
Posted - 07/29/2009 : 07:13:54 AM
|
Origin Ver. and Service Release: 8SR5 Operating System: WinXP
Hi
How can I manipulate "Layout" pages? I wrote a script creating multiple graphs and want them to be ready to print on one page...
Any ideas? Labtalk would be OK, too.
Thanks |
|
Iris_Bai
China
Posts |
|
bbjjbb
7 Posts |
Posted - 07/30/2009 : 03:27:06 AM
|
Hey, thanks.
Can I copy a table to a GraphPage, too? And: Can I set different sizes for the different plots?
like this:
|
|
|
Iris_Bai
China
Posts |
Posted - 07/31/2009 : 06:31:49 AM
|
Hi,
You can use CreateLinkTable function to create a worksheet table on graph, see http://ocwiki.originlab.com/index.php?title=OriginC:Graph_Add_Wks_Table for example.
And if want to set differnet size for each layer, you can use
bool layer_get_position(GraphLayer& gl, double* pLeft = NULL, double* pTop = NULL, double* pRight = NULL, double* pBottom = NULL, int* pUnit = NULL);
bool layer_set_position(GraphLayer& gl, double dLeft = 0, double dTop = 0, int* pUnit = NULL);
bool layer_set_size(GraphLayer& gl, double& dWidth, double& dHeight, int* pUnit = NULL);
There are many layer size and position functions in OriginC\Originlab\graph_utils.h file. In codes need include this header with "#include <..\Originlab\graph_utils.h>" and need add \OriginC\Originlab\graph_utils.c to current workspace.
Iris |
Edited by - Iris_Bai on 08/03/2009 11:18:46 PM |
|
|
bbjjbb
7 Posts |
Posted - 08/04/2009 : 05:20:02 AM
|
Hi again,
1. Thanks for all the tipps 2. I have another problem: When using page_arrange_layers() the text labels I added to the various graphs sometimes get collect in the middle of the sheet. I allready tried to remake them after the arranging with the same result... Any ideas how to solve this? |
|
|
Iris_Bai
China
Posts |
Posted - 08/05/2009 : 02:55:48 AM
|
Hi
Sorry, I cannot reproduce the problem you said above. I changed the example in this wiki page http://ocwiki.originlab.com/index.php?title=OriginC:Copy_and_Arrange_Layers to separate two functions, one is prepare_graphs to generate multiple graph pages, and another function arrange_all_graphs_into_one_graph is to arrange all layers from all graphs in current project to one new graph. You can run the first function to create pages, add Text Label on each graph, then call the second function to arrange layers. To see if still have same problem? Or can you send your graphs to me? Click Here to send files to me. Better send *opj file.
Iris |
|
|
bbjjbb
7 Posts |
Posted - 08/05/2009 : 03:52:11 AM
|
Hey
I sent the file to you (using the form)
I'm afraid I can't send you my "real" opj, so I used your example code to make a demonstration opj. I just inserted:
GraphObject grobj = gl.CreateGraphObject(GROT_TEXT,"textLabel"); char strLabel[100]; sprintf(strLabel,"LabelTest\n Label for graph %d",nYIndex); grobj.Text=strLabel;
right after gl.Rescale();
As you can see in the example opj all the labels are in the same place |
|
|
Iris_Bai
China
Posts |
Posted - 08/05/2009 : 05:19:37 AM
|
Hi,
I found in Origin8 SR5, the attach property of graph object created by GraphLayer::CreateGraphObject is Page, this is incorrect, should be Layer. But this bug already fixed in SR6.
In SR5, you can use the following way to change attach property from Page to Layer:
if(0 != grobj.Attach) //0 - to Layer; 1 - to Page; 2 - to Layer and Scales
grobj.Attach = 0;
Iris |
|
|
bbjjbb
7 Posts |
Posted - 08/05/2009 : 05:27:52 AM
|
Thanks, I'll try that.
where can I get SR6? when trying to download it I'm always getting an "File not found"-error. I tried to download it from the servers in Germany and the US |
Edited by - bbjjbb on 08/05/2009 05:28:18 AM |
|
|
Echo_Chu
China
Posts |
|
|
Topic |
|