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 )
);