T O P I C R E V I E W |
Naclador |
Posted - 06/30/2010 : 05:11:18 AM Origin Ver. and Service Release (Select Help-->About Origin): 7.5 SR 6 Operating System: XP
Hello out there,
I have trouble setting the properties of a GroupPlot from Origin C. I figure I have to use a tree to do so, but I don't know the names of the Nodes I need to set.
I tried the following code from Origin Wiki to get the Format Tree:
void ViewGraphFormatTree() { GraphLayer gl = Project.ActiveLayer(); if(!gl) return; Tree trFormat; trFormat = gl.GetFormat(FPB_ALL, FOB_ALL, TRUE, TRUE); out_tree(trFormat); // output format tree string strSaveTo = GetAppPath(false) + "FormatTree.xml"; if(trFormat.Save(strSaveTo)) out_str("Format Tree xml file saved to "+strSaveTo); }
But unfortunately all I get when I try to compile this is:
"Error, Member function GraphLayer::GetFormat not defined or does not have matching prototype."
What is this supposed to mean?!
I am grateful for any advice.
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~~ If something's hard to do, then it is not worth doing.
(H. Simpson) |
11 L A T E S T R E P L I E S (Newest First) |
camarad |
Posted - 07/13/2010 : 11:39:53 AM 234 |
Naclador |
Posted - 07/08/2010 : 05:20:03 AM Hi Penn,
thank you very much, with this information I should be able to solve my plotting issues.
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~ The fact that we live at the bottom of a deep gravity well, on the surface of a gas covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be.
Douglas Adams |
Penn |
Posted - 07/07/2010 : 10:24:44 PM Hi Naclador,
You can use LabTalk object layer.plot to activate any data plot, then the group of that plot will be activated, and the set command can be used to set width of line in this activated group.
For example, suppose there are two groups in layer one of your graph. There are two data plots in group one and three plots in group two. In LabTalk, the following script can used to set different line width in these two groups.
layer.plot=1; // activate first data plot in group one of the active layer
set %C -w 5000; // set line width of group one to 10 points
// activate first data plot in group two of the active layer
// note that, two plots in group one, the first plot in group two is with index of 3
layer.plot=3;
set %C -w 1000; // set line width of group two to 2 points
In Origin C, you can use the LT_execute function to execute the above script.
Penn |
Naclador |
Posted - 07/07/2010 : 04:06:54 AM Thank you, Penn,
but in LabTalk, how do I refer to a specific GroupPlot? In Origin C, I have an attached GroupPlot Object I can refer to.
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~ The fact that we live at the bottom of a deep gravity well, on the surface of a gas covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be.
Douglas Adams |
Penn |
Posted - 07/05/2010 : 9:48:01 PM Hi Naclador,
To set the line width, you can try to use the set command in LabTalk. And then in Origin C, you can call the LT_execute function to execute this LabTalk script. For example:
LT_execute("set %C -w 1000;"); // set line width to 2 points
Penn |
Naclador |
Posted - 07/05/2010 : 04:26:38 AM Thanks Penn,
but I fear an upgrade is out of the question for me except if I could get it for free.
Any other suggestions?
Has anyone a clue for me how the nodes for GroupPlots are named? There has to be a system, I just need the line color and line width nodes.
Thanks for your effort,
Naclador
PS: I can do the color with SetColor, if there is a similar solution for the linewidth, this would be just fine for me.
~~~~~~~~~~~~~~~~~~~~~~~~~ Never attribute to malice that which can be adequately explained by stupidity. (Hanlon's Razor) |
Penn |
Posted - 07/05/2010 : 01:20:33 AM Hi Naclador,
Yes, you are right, the bGetTagNames parameter is used for getting the real tag name for each treenode. I would recommend upgrading to Origin 8.1.
Penn |
Naclador |
Posted - 07/02/2010 : 04:23:57 AM Anyone, please?
I figure the bGetTagNames parameter is doing what I want, right? But is there a way to do it in Origin 7.5 SR6?
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~ Never attribute to malice that which can be adequately explained by stupidity. (Hanlon's Razor) |
Naclador |
Posted - 07/01/2010 : 04:43:38 AM Ok,
I deleted the additional arguments and it worked. But I am dissatisfied with the result. I got an xml file with all nodes characterized only by their NodeID, so I now have a heap of numbers without meaning to me. In some cases, I can guess from the values what the node is good for (data range, for example). But the rest is cryptic to me. I expected something like Line.Color.nVal or so. Is there a way to get the nodes with more meaningful names?
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~~ If something's hard to do, then it is not worth doing.
(H. Simpson) |
Naclador |
Posted - 07/01/2010 : 03:59:32 AM Hi Penn,
thaks a lot, I should have seen that by myself. On the other hand, I am a complete newbie to Origin C Programming, so maybe my ignorance is excusable.
Best,
Naclador
~~~~~~~~~~~~~~~~~~~~~~~~~~ If something's hard to do, then it is not worth doing.
(H. Simpson) |
Penn |
Posted - 06/30/2010 : 10:06:49 PM Hi Naclador,
The error message tells that the GetFormat method has no matching prototype. You are using Origin 7.5 SR6, right? The prototype of GetFormat method is:
Tree GetFormat(DWORD dwPropertiesFilter = FPB_ALL, DWORD dwObjFilter = FOB_ALL)
You can see that this prototype accepts only two arguments. However, the one called in your code contains four arguments.
From Origin 8, the GetFormat method has been improved, more and more arguments are accepted. Currently (in Origin 8.1 SR3), the prototype of this method is:
Tree GetFormat( DWORD dwPropertiesFilter = FPB_ALL, DWORD dwObjFilter = FOB_ALL, BOOL bGetTagNames = TRUE, BOOL bRelative = FALSE, DWORD dwPropertiesFilter2 = FPBEX_ALL, DWORD dwObjFilter2 = FOB2_ALL, vector<int> * piaErrors = NULL, vector<string> * psaErrors = NULL )
If you are interested in, you can download a demo of Origin 8.1 SR3 from this page and try your code again.
Penn |
|
|