Automating JMP 7 - How to open the current document?
Feb 4, 2009 6:02 PM(2616 views)
I'm trying to automate JMP 7 for a DOE project from C#. I managed to create a design using the DOECustom object, but couldn't find a way to launch a FitModel - as the FitModel object depends on a valid Document object, and the only way to have a Document object seems to be through 'JMP.Application.OpenDocument'.
So is there anyway to open the current document? Thanks.
OK. I solved the problem myself. There's a JMP.DataTable.Document which you can get a reference of the current document from.
Though another problem popped up. As I went through to the Prediction Profiler in the 'Fit Least Square' result dialogue, it seemed the 'Maximize Option' is inaccessible from the object 'FitProfiler'. Is there anyway to work around this? Thanks.
Unfortunately, there is not a programmatic way to set the Maximization Options for the profiler. Automation attempts to expose those functions that are generally available to JMP scripting (JSL). While you can using scripting to produce the Maximization Options dialog, you cannot specify the actual values without producing the dialog. Because of this, the option was not added to automation. We did not want to put up a dialog that could potentially stop a running job without operator knowledge.
Thanks for your reply. So is there a possible way to work this out by inline JSL scripting with FitModel.RunCommand("") ?
I dont know much about JSL, and right now what I can do is to get the Window object by:
obj=window("DOE- Custom Design");
and get the child displays by iteratoring with obj["Obj Display Name"]. Is there a way to get the FitModel object (Window -> Platform) so that I can simulate the 'hot button clicking'? Help will be appreciated.
The short answer is "yes," but I'm not sure which part you're asking about. You seem to know how to get a window object and how to access its children. (Great.) Maybe what you're missing is that when you get a reference to a button, you can send it an "Action" message to simulate a click on it. Something like
btn = obj[ButtonBox(2)]; btn << Action;
The relevant part of the manual is called DisplayBox Scripting.
Thanks for your help. I think I didn't express myself clearly enough. What I want is to simulate the behaviour of clicking: 1. The 'Red Dot' button on 'Prediction Profiler'. 2. Choose 'Maximization Options' and tick 'Save Iterations to a log table'. 3. Choose 'Maximize Desirabilities' to generate the best in trip table.
I've been trying to use COM, though as Brian said it was not provided in the 'Profiler' interface. So I'm now thinking about inline a JSL script in my C# program, which simply does 'SendMessage(Click, Red Dot), SendMessage(Tick, 'XXXX').... etc.
Then I think you're back to what Brian said: "While you can using scripting to produce the Maximization Options dialog, you cannot specify the actual values without producing the dialog." You can try Tech Support -- they may have a work-around or can at least open an issue for it.