Hi Stefan Bollmann,
In Origin C, the methods OriginObject::GetFormat and OriginObject::ApplyFormat can be used to get and set format for an Origin object. You can refer to the examples about how to access graph format with theme tree. The following code will set all the graph layers to be the same position and with the same size.
void testLayer()
{
GraphLayer glActive = Project.ActiveLayer();
if(!glActive)
return;
GraphPage gp(glActive.GetPage());
if(!gp)
return;
foreach(GraphLayer gl in gp.Layers)
{
Tree trFormat;
trFormat = gl.GetFormat(FPB_ALL, FOB_ALL, true, true); // get theme tree
trFormat.Root.Dimension.Left.dVal = 15.0;
trFormat.Root.Dimension.Top.dVal = 10.0;
trFormat.Root.Dimension.Width.dVal = 30.0;
trFormat.Root.Dimension.Height.dVal = 35.0;
gl.ApplyFormat(trFormat, true, true); // set the format tree to the graph layer
}
//out_tree(trFormat); // can print the theme tree to see the format
}
Penn