Hi. Is there a method to get the variable names & roles used in a graph builder window? Suppose I have a window containing a graph builder plot. Is there a way to programmatically determine which variable was used for X, Y, Xgroup, Ygroup, etc?
For example, suppose the user created a plot in gb. Now they wish to run some generalized script on the plot (e.g. a graphics script). The script needs to know what variables were used in which roles without the user telling it.
Suppose I start with this plot:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
Variables(X(:height), Y(:weight)),
Elements(Points(X, Y), Smoother(X, Y))
);
Now I wish to run a script on the resulting plot. My script is unaware of what is contained in the plot. Here are 2 things I tried but did not work:
Names Default to Here(1);
//Try to get script used to create plot
win = Window(1); //gets most recent window clicked on
gb = win << Report; //DNW: returns missing (win is not a platform)
scr = gb << Get Script; //from here I could parse the string to determine the roles
//Another stab: try to read the XML
win = Window(1);
str = win << Get XML; //This gives me the XML of the window, but does not provide the actual variable names used in the roles.
If I could figure out how to convert the window reference into a report, I think I could get that first method to work. Any ideas?