大家好,
我開始學習腳本編寫,並嘗試製作一個帶有 6 個散點圖的視窗:2 個垂直 + 3 個水平。
我嘗試過雙 for 循環,但我不知道為什麼它不起作用。 它沒有給出錯誤,但我無法獲取圖像。代碼是:
BladeList = List( "Blade8", "Blade61", "Blade74" );
New Window( "Oneway Advisor",
H List Box(
For( j = 1, j <= 2, j++,
V List Box(
For( i = 1, i <= 3, i++,
Write(i);
Scatterplot 3D(
Y( :Name( " x" ), :y, :z ),
Coloring( :Name( " Mean Io" ) ),
Legend( 1522 ),
Frame3D(
Legend( 1 ),
Set Grab Handles( 0 ),
Set Rotation( -64, 0, -41 ),
Set Marker Scale( 5.2652 )
),
Where( :Blade == BladeList[i] & :Embodiment == "THP" ),
SendToReport(
Dispatch(
{},
"100",
ScaleBox,
{Legend Model(
1522,
Properties(
0,
{gradient( {Color Theme( "Jet" )} )},
Item ID( " Mean Io", 1 )
)
)}
)
)
)
);
),
);
);
);但是,如果我嘗試單一循環,它會起作用:
BladeList = List( "Blade8", "Blade61", "Blade74" );
New Window( "Oneway Advisor",
H List Box(
/*For( j = 1, j <= 2, j++,*/
V List Box(
For( i = 1, i <= 3, i++,
Write(i);
Scatterplot 3D(
Y( :Name( " x" ), :y, :z ),
Coloring( :Name( " Mean Io" ) ),
Legend( 1522 ),
Frame3D(
Legend( 1 ),
Set Grab Handles( 0 ),
Set Rotation( -64, 0, -41 ),
Set Marker Scale( 5.2652 )
),
Where( :Blade == BladeList[i] & :Embodiment == "THP" ),
SendToReport(
Dispatch(
{},
"100",
ScaleBox,
{Legend Model(
1522,
Properties(
0,
{gradient( {Color Theme( "Jet" )} )},
Item ID( " Mean Io", 1 )
)
)}
)
)
)
);
),
V List Box(
For( i = 1, i <= 3, i++,
Write(i);
Scatterplot 3D(
Y( :Name( " x" ), :y, :z ),
Coloring( :Name( " Mean Io" ) ),
Legend( 1522 ),
Frame3D(
Legend( 1 ),
Set Grab Handles( 0 ),
Set Rotation( -64, 0, -41 ),
Set Marker Scale( 5.2652 )
),
Where( :Blade == BladeList[i] & :Embodiment == "THP" ),
SendToReport(
Dispatch(
{},
"100",
ScaleBox,
{Legend Model(
1522,
Properties(
0,
{gradient( {Color Theme( "Jet" )} )},
Item ID( " Mean Io", 1 )
)
)}
)
)
)
);
),
/*);*/
);
);誰能幫我這個。
謝謝你,
大衛
我知道這是一個有點舊的線程,但我無法說出修復嵌套循環問題的兩組程式碼之間的根本變化是什麼。 我在使用嵌套循環的工具之一中遇到錯誤,我希望它是相關的。
編輯:這只是使用 HLB 附加功能的問題嗎?
我無法讓雙循環工作,但是,下面的方法將為您提供您想要的結果
BladeList = List( "Blade8", "Blade61", "Blade74" );
New Window( "Oneway Advisor",
hlb = H List Box()
);
For( j = 1, j <= 2, j++,
vlb = V List Box(
For( i = 1, i <= 3, i++,
sc = Scatterplot 3D(
invisible,
Y( :Name( " x" ), :y, :z ),
Coloring( :Name( " Mean Io" ) ),
Legend( 1522 ),
Frame3D(
Legend( 1 ),
Set Grab Handles( 0 ),
Set Rotation( -64, 0, -41 ),
Set Marker Scale( 5.2652 )
),
Where( :Blade == BladeList[i] & :Embodiment == "THP" ),
SendToReport(
Dispatch(
{},
"100",
ScaleBox,
{Legend Model(
1522,
Properties( 0, {gradient( {Color Theme( "Jet" )} )}, Item ID( " Mean Io", 1 ) )
)}
)
)
),
)
);
hlb << append( vlb );
);