Use XPath to get reference to the Axisboxes you are interested in (X, Y axis or both) and then do whatever you want with that list of axisboxes. This example enables Major Grid for Y-axis on all the frameboxes
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(893, 542),
Show Control Panel(0),
Variables(X(:weight), Y(:height), Page(:age, Levels per Row(3)), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)))
);
abs = Report(gb) << XPath("//AxisBox");
yaxis = abs[2::NItems(abs)::2];
yaxis << Show Major Grid(1);

-Jarmo