cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
mystylelife19
Level III

How to set spec limit on specific column

Hi community. I'm having trouble on this scripts from ChatGPT. I want to build a scripts that can pick certain column in 'Choice Box' and set the Spec Limit upper & lower also shows as graph reference lines on Column Properties. After that it will open the Fit Y by X graph and shows like picture below. Please help... @txnelson 

// Open a data table or replace "Data Table Name" with the name of your data table
dt = Current Data Table();

// Get the column names from the data table
columnNames = dt << Get Column Names("String");

// Create a new choice list
cl = New Window("Column Selection",
    H List Box(
        Choice Box(
            columnNames,
            "Select a Column",
            Value(columnNames[1]),
            Set Selected
        ),
        Button Box("OK",
            <<Close Window
        ),
        Button Box("Cancel",
            <<Close Window
        )
    )
);

// Wait for user input
Wait(1);

// Get the selected column name
selectedColumn = cl[1] << Get Selected;

// Close the window
Close(cl, NoSave);

// Open the column properties
dt << Column( selectedColumn ) << Column Info;

// Get the lower and upper spec limits from the user
lowerSpecLimit = Get Number("Enter the Lower Spec Limit:");
upperSpecLimit = Get Number("Enter the Upper Spec Limit:");

// Set the spec limits for the selected column
dt << Set Column Property(
    selectedColumn,
    "Spec Limits",
    {Lower Limit(lowerSpecLimit), Upper Limit(upperSpecLimit)}
);

// Open a Fit Y by X with the selected column
Fit Group(
	Bivariate(
		Y( :Y ),
		X( :X ),
		SendToReport(
			Dispatch(
				{},
				"Bivar Plot",
				FrameBox,
				{Row Legend(
					HWBinName,
					Color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 0 ),
					Marker Theme( "" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			)
		)
	),
	
	Bivariate( Y( Eval(selectedColumn) ), X( :X ) )
	<<{Arrange in Rows( 2 )},
	By( :WAFER_ID )
	);
1 ACCEPTED SOLUTION

Accepted Solutions
Ressel
Level VI

Re: How to set spec limit on specific column

Hi, my feeling is, there is much wrong with this script. Below, I've just provided some of the very first impressions reading your ChatGPT generated script from top to bottom, ignoring much else which looks incorrect.

 

This does not appear to be JSL:

Choice Box();

I suspect you want to replace this with something like:

Col List Box();

In your "choice list", the scripts for the two button boxes were not working, perhaps even preventing the creation of the window. If this part of the script is modified like shown below, this will create a window with the buttons working as I think you wanted them to work.

// Create a new choice list
cl = New Window("Column Selection", 
    H List Box(
       Col List Box(
            all,
            width( 250 ), maxSelected( 1 ) 
        ),
        Button Box("OK",
          cl  <<Close Window  // use reference to window in button script
        ),
        Button Box("Cancel",
          cl  <<Close Window // same here
        )
    )
);

Wait for user input for one second? I am not sure if this makes sense and is at all required.

// Wait for user input
Wait(1);  //  what is the use of this?

"cl" is a reference to the window created, but you (or ChatGPT) are using it as if it was a table reference.

// Get the selected column name
selectedColumn = cl[1] << Get Selected;  // cl is not a table reference

// Close the window
Close(cl, NoSave); // cl is not a table reference

Not a very experienced scripter, but in the one instance were I have tasked ChatGPT with writing a JSL code snippet, it did not work, even though it was only a very simple task. At one point it even "forgot" that the topic of our conversation was JSL, which it seemingly confused with something else abbreviated with JSL. One reference that helped me a lot getting started with scripting is Jump into JMP scripting. You also want to check the JMP Scripting Guide and Scripting Index.

 

 

View solution in original post

2 REPLIES 2
Ressel
Level VI

Re: How to set spec limit on specific column

Hi, my feeling is, there is much wrong with this script. Below, I've just provided some of the very first impressions reading your ChatGPT generated script from top to bottom, ignoring much else which looks incorrect.

 

This does not appear to be JSL:

Choice Box();

I suspect you want to replace this with something like:

Col List Box();

In your "choice list", the scripts for the two button boxes were not working, perhaps even preventing the creation of the window. If this part of the script is modified like shown below, this will create a window with the buttons working as I think you wanted them to work.

// Create a new choice list
cl = New Window("Column Selection", 
    H List Box(
       Col List Box(
            all,
            width( 250 ), maxSelected( 1 ) 
        ),
        Button Box("OK",
          cl  <<Close Window  // use reference to window in button script
        ),
        Button Box("Cancel",
          cl  <<Close Window // same here
        )
    )
);

Wait for user input for one second? I am not sure if this makes sense and is at all required.

// Wait for user input
Wait(1);  //  what is the use of this?

"cl" is a reference to the window created, but you (or ChatGPT) are using it as if it was a table reference.

// Get the selected column name
selectedColumn = cl[1] << Get Selected;  // cl is not a table reference

// Close the window
Close(cl, NoSave); // cl is not a table reference

Not a very experienced scripter, but in the one instance were I have tasked ChatGPT with writing a JSL code snippet, it did not work, even though it was only a very simple task. At one point it even "forgot" that the topic of our conversation was JSL, which it seemingly confused with something else abbreviated with JSL. One reference that helped me a lot getting started with scripting is Jump into JMP scripting. You also want to check the JMP Scripting Guide and Scripting Index.

 

 

mystylelife19
Level III

Re: How to set spec limit on specific column

Thankyou for your reply. Okay i will looking into it.