Hi,
Unfortunately that X-Function doesn't allow specifying the theme as a file.
But we can create a LabTalk-callable Origin C function that essentially does the same thing as the X-function but can use a theme file. Here it is followed by explanation and usage example:
int joker_theme_file_apply_2_graph(string strThemeFile, string strGraphName = "")
{
GraphPage gp;
if (strGraphName.GetLength() > 0)
gp = Project.Pages(strGraphName);
else
gp = Project.Pages();
if (!gp.IsValid())
return false;
if (!strThemeFile.IsFile())
return false;
return gp.ApplyFormat(strThemeFile, TRUE, FALSE, TRUE);
}
You must specify a full path to the theme file including file extension (OTH).
It only operates on one graph at a time- either the one you specify or the active graph depending on whether you pass it a graph name as the 2nd parameter.
For example, to apply the theme file to a certain graph, you'd run the following in LabTalk:
string strFile$ = "%YJoker Scripts\JokerTheme.oth";
string strGraph$="Graph1";
joker_theme_file_apply_2_graph(strFile$, strGraph$);
To apply the theme file to the active graph, you'd run:
string strFile$ = "%YJoker Scripts\JokerTheme.oth";
joker_theme_file_apply_2_graph(strFile$);
I hope this helps.
Thanks,
Chris Drozdowski
Originlab Technical Support