Removes the layer from the view.

syntaxSyntax:
DlxView.RemoveLayer(layer)

Parameters

Parameter Description
layer The DlxLayer to remove.

Return Value

If the operation ends correctly it returns true otherwise it returns false.

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))
  {
    var view = page.GetActiveView();
    if (view.IsValid())
    {
      var layer = view.GetActiveLayer();
      DlxApp.Printf("The active view is %s and includes %i layers. Active layer is: %s", view.GetName(), view.GetLayerCount(), layer.GetName());
      view.RemoveLayer(layer);
      layer = view.GetActiveLayer();
      DlxApp.Printf("The active view is %s and includes %i layers. Active layer is: %s", view.GetName(), view.GetLayerCount(), layer.GetName());
    }
  }
}

See also