BookmarkSubscribe
Choose Language Hide Translation Bar
Pearl
Occasional Contributor

JMP scripting - Double FOR loop: H List Box and V List Box

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

 

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JMP scripting - Double FOR loop: H List Box and V List Box

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 );
);
Jim
2 REPLIES 2
txnelson
Super User

Re: JMP scripting - Double FOR loop: H List Box and V List Box

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 );
);
Jim
Pearl
Occasional Contributor

Re: JMP scripting - Double FOR loop: H List Box and V List Box

Thank you very much txnelson for your help! It works perfectly.
0 Kudos