Copy All Layers

 

Version Info

Minimum Origin Version Required: Origin 8 SR0

Example

void wks_copy_all_layers_ex()
{
    // create a workbook with two worksheets FFT and IFFT 
    WorksheetPage wksPageFrom1;
    wksPageFrom1.Create("FFT");    
    wksPageFrom1.Layers(0).SetName("FFT");
    wksPageFrom1.AddLayer("FFTEx");
 
    WorksheetPage wksPageFrom2;
    wksPageFrom2.Create("IFFT");
    wksPageFrom2.Layers(0).SetName("IFFT");
     wksPageFrom2.AddLayer("IFFTEx");

    // create a new workbook
    WorksheetPage WksPageTo;
    WksPageTo.Create();
    WksPageTo.Rename("To");
 
    // copy add the layers from the above two books to this book
    WksPageTo.AddLayers(wksPageFrom1);
    WksPageTo.AddLayers(wksPageFrom2);
    WksPageTo.Layers(0).Delete();    // delete the default sheet
}