Ciao a tutti,
Ho iniziato a imparare lo scripting e sto provando a fare una finestra con 6 scatteplot: 2 verticali + 3 orizzontali.
Ho provato un ciclo double for ma non so perché non funziona. Non dà errori ma non riesco a ottenere le immagini. Il codice è:
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 )
)
)}
)
)
)
);
),
);
);
);Tuttavia, se provo un singolo ciclo funziona:
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 )
)
)}
)
)
)
);
),
/*);*/
);
);Qualcuno mi può aiutare con questo.
Grazie,
Davide
So che questo è un thread un po' vecchio da riportare, ma non posso dire quale sia stato il cambiamento fondamentale tra i due set di codice che ha risolto il problema del ciclo nidificato. Ricevo un errore in uno dei miei strumenti utilizzando un ciclo nidificato, spero che sia correlato.
Modifica: è solo questione di utilizzare la funzionalità di aggiunta di HLB?
Non sono riuscito a far funzionare il doppio ciclo, tuttavia, il metodo seguente ti darà i risultati desiderati
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 );
);