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
 Change incremental line color inc. line style
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

HTNicolai

Netherlands
Posts

Posted - 05/24/2005 :  06:44:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0383
Operating System: Win XP

Hello,

I'm trying to make a Origin C script that changes a graph with colored plots into a graph with black plots (with different styles) and vice versa.
There is a handy option in Origin itself. You can access it by right-clicking a graph, choosing "Plot Details" and then select a group of plots. When the Edit-mode is set to "Dependent", you can select either "incremental color" and/or "incremental style".

Is there a way to access this setting in Origin C? Or do I have to make a script which changes the color of all the lines one by one?

Thank you!

rdremov

USA
28 Posts

Posted - 05/25/2005 :  5:14:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This feauture is only available in Origin 7.5 as part of new Theme Object Property Access mechanism:


#include <Origin.h>

void example_incrementor_access(int nGroupPlotIndex = 0)
{
// active graphic layer
GraphLayer gl = Project.ActiveLayer();

if( !gl )
return;

// get group plot by index from the active layer
GroupPlot gPlot = gl.Groups(nGroupPlotIndex);

if( !gPlot )
return;

// just for debugging purpose to show what is inside
TreeNode tr = gPlot.Increment;
out_tree(tr);

//////////////////////////////////////////////////////////////
// nester is array of integers
// order is only used if Nested =1
// if not nested, then index of array is not important
// values of the nester array can be any of the following:
// 0 - COLOR
// 1 - BKCOLOR
// 2 - STYLE
// 3 - SHAPE
// 4 - EDGECOLOR
// 5 - FILLCOLOR
// 6 - PATTERN
// 7 - PATTERNCOLOR
// 8 - INTERIOR
// 9 - CHARACTER
// if some value is present, it means it will be incremented
// according to corresponding increment list

// nest only shape
vector<int> vv = {3}; // see above, 3 is for shape

// this line does it all
gPlot.Increment.Nester.nVals = vv;
}


Edited by - rdremov on 05/25/2005 5:17:24 PM

Edited by - rdremov on 05/25/2005 5:18:30 PM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 05/25/2005 :  6:05:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have created the following example to help illustrate

 

void set_group_plot_increment_by(BOOL bColor, BOOL bShape, BOOL bSymbolInterior, int nGroupIndex = 0)
{
GraphLayer gl = Project.ActiveLayer();

if( !gl )
return;

// get group plot by index from the active layer
GroupPlot gPlot = gl.Groups(nGroupIndex);

if( !gPlot )
return;

vector<int> vv;
if(bShape)
vv.Add(3); // 3 is for symbol shape
if(bColor)
vv.Add(0); // 0 for line color, which is also symbol color
if(bSymbolInterior)
vv.Add(8); // 8 for symbol interior

gPlot.Increment.Nested.nVal = 0; // not to be nested, as that will be more complicated
gPlot.Increment.Nester.nVals = vv;
}





CP


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