cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
BooBee
Level III

Error in running script - Send Expects Scriptable Object in access or evaluation of 'Send' , dt <<  /*###*/get column names( string, continuous ) /*###*/

I have modified the script shared earlier by one of the contributors (thank you) so that the user can choose which data file (.jmp) file to open:

 

Names Default To Here( 1 );

// Open a dialog to choose a .jmp file to open

// Get the filename of the .jmp file to open
dt = Pick File("Select a .jmp file to open", "", {"JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, "");

// If the user did not select a file, exit the script
If( Is Missing( dt ),
	Throw(), 
	// Else Open the selected file
	Open( dt )
);

// Get all of the numeric column's names
colNameList = dt << get column names( string, continuous );

// Take the data from rows 1 & 2 and create the Spec Limits column property
For Each( {col}, colNameList,
	Eval(
		Substitute(
				Expr(
					Column( dt, col ) << set property(
						"Spec Limits",
						{LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
					)
				),
			Expr( _LSL_ ), As Column( dt, col )[1],
			Expr( _USL_ ), As Column( dt, col )[2]
		)
	)
);

// Exclude and Hide row 1 & 2 to eliminate them from Distributions
dt << Select rows( {1,2} );
dt << hide and exclude;

// Run the Distribution Platform
dt << Distribution( column( eval(colNameList) ));

When running the script, I ran into the following error:

Send Expects Scriptable Object in access or evaluation of 'Send' , dt <<  /*###*/get column names( string, continuous ) /*###*/

It seemed there is a problem with the dt << get columns names?


I have also attached a copy of the data file which I would like to process. 1st and 2 rows of data are the LSL and USL respectively, which I do not want to be included as part of the data. But rather they are used to plot the LSL and USL lines in the Distribution graph.

 

Appreciate any help from the community. Thank you!

11 REPLIES 11
txnelson
Super User

Re: Error in running script - Send Expects Scriptable Object in access or evaluation of 'Send' , dt <<  /*###*/get column names( string, continuous ) /*###*/

Yes, all that needs to be done is to loop across the output and adjust each of the axes.  See below

names default to here(1);

// Get the filename of the .jmp file to open
dt = Pick File("Select a .jmp file to open", "", {"JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, "");

// If the user did not select a file, exit the script
If( Is Missing( dt ),
    Throw(),
    // Else Open the selected file
    dt = Open( dt )
);

// Get all of the numeric column's names
colNameList = dt << get column names( string, continuous );

// Take the data from rows 1 & 2 and create the Spec Limits column property
For Each( {col}, colNameList,
    Eval(
        Substitute(
            Expr(
                Column( dt, col ) << set property(
                    "Spec Limits",
                    {LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
                )
            ),
            Expr( _LSL_ ), As Column( dt, col )[1],
            Expr( _USL_ ), As Column( dt, col )[2]
        )
    )
);

// Exclude and Hide row 1 & 2 to eliminate them from Distributions
dt << Select rows( {1,2} );
dt << hide and exclude(1);

// Run the Distribution Platform
dist = dt << Distribution( column( eval(colNameList) ));

// Loop across the output and addjust the axes 
rdist = dist << report;
For Each( {col, i}, colNameList,
	offset = (Column( col )[2] - Column( col )[1]) * .1;
	myMin = Column( col )[1] - offset;
	myMax = Column( col )[2] + offset;
	// Adjust Min and Max Y-axis
	rdist[axis box( i )] << Min( myMin ) << Max( myMax );
);
Jim
BooBee
Level III

Re: Error in running script - Send Expects Scriptable Object in access or evaluation of 'Send' , dt <<  /*###*/get column names( string, continuous ) /*###*/

Hi Jim,

 

Thank you so much for guiding me through this journey!