I am trying to apply the color of a curve in VIEW to a curve in REPORT.
This line returns the color of the curve in VIEW to as a string, for example "red"
curveCol = View.Sheets(4).Areas(1).DisplayObj.Curves2D(5).Color
However, I cannot figure out how to apply this color to a curve in REPORT. REPORT appears to expect something like: -
or colors expressed in RGB format.
How can I use the color obtained from View in Report?
Can anyone help please?
Solved! Go to Solution.
You are correct in noticing that the properties for VIEW and REPORT are different. There was more reason to give more color flexibility in REPORT than VIEW, since it was designed to produce the final versions of diagrams.
Since you are already using scripting, it should be fairly easy to write a select statement that assigns the RGB color values to the strings that VIEW returns. Is this an option for you to use? Let me know if you have questions!
Thanks for the reply.
Yes, I could write a script to convert the colours to RGB, but am I not just missing some simple variable? The report 'D2CURVECOLOR' variable works if I format my script like this: -
D2CChnXName = View.Sheets(1).Areas(1).DisplayObj.Curves(1).XChannelName
D2CChnYName = View.Sheets(1).Areas(1).DisplayObj.Curves(1).YChannelName
D2CURVECOLOR = View.Sheets(1).Areas(1).DisplayObj.Curves(1).Color
but then I have to use GraphObjOpen and so on, which I was hoping to avoid. Is there a variable like D2CURVECOLOR which I can use with OOP methods without having to open and close graph objects?
Nope, you're not missing anything. VIEW and REPORT were developed on different code bases, so they've each got a unique implementation of the curve color. This makes it a little more difficult to move between the two, but makes it a lot easier to stay backwards-compatible. It's up to you whether you'd rather use the D2CURVECOLOR or write up a select case.