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
 edge / fill color symbol
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

papangue

France
Posts

Posted - 01/11/2005 :  12:00:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:Win2k

Hello,
I wanted to linked the edge/fill color the corresponding RGB data stored in a worksheet, like this:
Plot Detail Dialogue Box -> Symbol Tab
edge/Fill Color = Direct RGB -> choose corresponding column
But i want to make it in OriginC (and or LabTalk)

Has anyone an idea?

Thanks

easwar

USA
1965 Posts

Posted - 01/11/2005 :  2:08:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The following is an Origin C solution.

First of all, to know what properties are available and what to set, you can first copy the theme/collection of properties of an object to a tree and dump the tree to script window, using code such as below:


void dump_format()
{
GraphLayer gly = Project.ActiveLayer();
DataPlot dp = gly.DataPlots(0);
if( !dp ) return;

Tree trFormat;
trFormat = dp.Curve.Symbol;
out_tree(trFormat);
}



If you run the above with a data plot in the active layer where the symbol color is set to use RGB based on values in the column right next to the Y column, you will see an output like below:

Symbol
Font
Face = 0
Bold = 0
Italic = 0
Underline = 0
Size = 12.
Scale = 1.
Type = 0
Shape = 2
Interior = 0
Character = 0
User = 0
EdgeWidth = 255.
EdgeColor = 8388709
FillColor = 0
Outline = 0

So from the above output you see that the property of interest to you is "EdgeColor = 8388709".

Then in order to change this, you can write code such as:

void change_format()
{
GraphLayer gly = Project.ActiveLayer();
DataPlot dp = gly.DataPlots(0);
if( !dp ) return;

// Set the color to be RGB with RGB values from 2nd column
// to the right of the Y column that is plotted.
// So value to be set = 8388708 + offset for RGB column
dp.Curve.Symbol.EdgeColor.nVal = 8388710;
}



If you change the color type from RGB to Indexing etc, the offset number (8388708 in the above case of RGB) will be different. And for fixed colors such as the default black, red, green etc the number will be 0, 1, 2 etc for example.

Easwar
OriginLab

Go to Top of Page

papangue

France
Posts

Posted - 01/12/2005 :  03:44:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks a lot for the method and the explanations
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