嗨,大家好,
我正在构建一个脚本来自动化我们执行的常规图形。
我已编写了一个脚本窗口,操作员可以在其中选择3个不同的图例参数中的1个,并且此选择的参数应用作下图的“颜色”。我使用RadioBox是因为运算符应该只能选择1(与CheckBox相反)。
现在我正在考虑使用诸如“如果RadioBox变1,然后使用图例1作为颜色”之类的东西。
我尝试了以下操作,但是它不起作用,脚本只跳过了“颜色”设置:
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 ))
),
我不太了解(1) 怎么样构造实际的“ if radiobox = 1”,以及(2) 哪里将其放置在脚本中。
我共享的是一个简化的版本,在我的实际脚本中,我构建了约35个图,因此我不想放置“ If radiobox = 1”,然后放置“图例为1的图生成器”(并执行3 x 35)否则这将是疯狂的
你有什么想法吗?
抄送 @martindemel
请查看《脚本指南》,了解可以将哪些消息传递给RadioBox();。
帮助==>脚本索引==>单选框()
您的脚本即将完成。以下是脚本,并进行了2处修改以使其正常工作。
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>