Initialize the layer stack by loading it from a file on disk.

syntaxSyntax:
DlxPage.LoadLayerStack(fileName)

Parameters

Parameter Description
fileName The file name. If the full path is not specified, the file is searched in the template folders. If this string is empty, a dialog box appears where you can specify the file name.

Return Value

If the layer stack is loaded correctly, it returns true, otherwise it returns false. If the page contains objects it returns false.

Remarks

This function requires a blank page without any object.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example PCB");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example PCB");
var doc = prj.GetDocument("Examples PCB", DlxApp.DOCTYPE_PCB);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Pcb", DlxApp.DOCTYPE_PCB);
  doc.SetPageFormat("A4", false);
  var page = doc.NewPage("PCB", 0, true);
  page.LoadLayerStack("2 layer pcb stackup.clxlys");
  page.DrawBoard(new DlxRect(10, 10, 290, 200));
  page.SelectView("Draw Copper From Top");
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.FindPage("PCB");
  if (page.IsValid() && doc.SelectPage(page))
  {
    DlxApp.Printf("The %s page has %i views.", page.GetName(), page.GetViewCount());
    for (var i = 0; i < page.GetViewCount(); i++)
    {
      DlxApp.Printf("View %i = %s", i, page.GetView(i).GetName());
    }
  }
}

See also