Hi everyone,
I started to learn scripting and I'm trying to do a Window with 6 scatteplot: 2 vertical + 3 horizontal.
I've tried a double for loop but I don't know why it doesn't work. It gives no error but I cannot get the images.The code is:
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 )
)
)}
)
)
)
);
),
);
);
);However if I try a single loop it works:
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 )
)
)}
)
)
)
);
),
/*);*/
);
);Can anyone help me with this.
Thank you,
David
I know this is a bit of an old thread to bring back, but I can't tell what was the fundamental change between the two sets of code that fixed the nested loop issue. I'm getting an error in one of my tools using a nested loop, I'm hoping it is related.
Edit: Is it just a matter of using that HLB append functionality?
I was not able to get the double loop to work, however, the below method will get you he results you want
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 );
);