Hi everyone,
I'm building a script to automatize the routine graphs that we do.
I have scripted a window where the operator can select 1 out of 3 different legend parameters, and this selected parameter should be used as "Color" of the following graph. I used RadioBox as the operator should be able to select only 1 (at the opposite of CheckBox).
Now I was thinking to use something like "If RadioBox gets 1, then use Legend 1 as Color" etc.
I tried the following but it doesn't work, the script just skip the "Color" setting:
Color(
If (rb << Get (1), :Legend 1 ) ,
If (rb << Get (2), :Legend 2 ),
If (rb << Get (2), :Legend 2 )
)
If (rb << Get (1), Color(:Legend 1 )) ,
If (rb << Get (2), Color(:Legend 2 )),
If (rb << Get (2), Color(:Legend 2 ))
),
I don't really understand (1) how to construct the actual "if radiobox = 1", as well as (2) where to place it in the script.
What I shared is a simplified version, in my actual script I have ~35 graphs that are built so I don't want to put the "If radiobox = 1", then "graph builder with legend 1" (and do it for 3 x 35) otherwise this is going to be crazy
Do you have any idea how to do that?
CC @martindemel
Please look to the Scripting Guide for what messages can be passed to a RadioBox();
Help==>Scripting Index==>Radio Box()
Your script was almost complete. Below is the script, with the 2 modifications I made to make it work.
Names Default To Here( 1 );
// Open a window to select parameters to be plotted:
window = New Window( "Graph parameters",
Outline Box ("Please select of the parameter to be used in the legend"),
rb = Radio Box ({"Legend 1", "Legend 2", "Legend 3"}),
Button Box( "Create graphs",
theLegend = rb << get selected;
// Create a Journal:
Journal = New Window("Journal graphs", <<JOURNAL></JOURNAL>