It returns the active Layer object. The active Layer object corresponds to the active layer in the active window (graph, worksheet, matrix, or layout).
Layer ActiveLayer( )
The active Layer object.
//with a new project, try new wks, new graph, new matrix, new layout and a new notes window
//when notes window is active, the ActiveLayer is not changed, so you should see the last active
//layer when a notes window is active
Layer lay = Project.ActiveLayer();
out_str("the project is empty");
Worksheet wks = lay;// try casting into a worksheet
printf("Active sheet has %d columns and %d rows\n", wks.GetNumCols(), wks.GetNumRows());
// if not a worksheet, try a graph
GraphLayer glay = lay;
printf("Active graph as %d data plots\n", glay.DataPlots.Count());
out_str("Active layer might be a matrix or a layout page");
Project::ActiveCurveBase, Project::ActiveCurve, Project::ActiveFolder