Layer
The Layer class provides methods and properties common to all internal Origin layers. All Origin pages (windows) except note pages contain one or more layers.
Origin objects found "on" a page are generally contained by layers which are themselves contained by the page. Origin layers may contain many different graph objects thus the Layer class contains a collection of all the graph objects in the layer.
An Origin C Layer object is a wrapper object that is a reference to an internal Origin layer object. Origin C wrapper objects do not actually exist in Origin and merely refer to the internal Origin object. Consequently, multiple Origin C wrapper objects can refer to the same internal Origin object.
The Layer class is derived from the OriginObject class from which it inherits methods and properties.
EX1
int Layer_ex1() { // Call this function with a graph layer active // // Declare a layer object and point to currently active layer Layer ly = Project.ActiveLayer(); if( ly.IsValid() ) { // Get and report name of page containing this layer Page pg = ly.GetPage(); printf( "Active layer is contained in page: %s\n", pg.GetName() ); // If page is a graph page... if( EXIST_PLOT == pg.GetType() ) { // List the name of all graph objects in the layer GraphObject gobj; foreach( gobj in ly.GraphObjects ) printf( " Graph object: %s\n", gobj.GetName() ); return 0; } else return 1; } else { out_str( "Invalid layer object\n" ); return 2; } }
origin.h