嗨,大家好,
我正在構建一個腳本來自動化我們執行的常規圖形。
我已編寫了一個腳本窗口,操作員可以在其中選擇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>