Adds a new layer in the page.

syntaxSyntax:
DlxPage.NewLayer(name, type)

Parameters

Parameter Description
name The name of the layer.
type The type of layer. Specify one of the following values:
Value
DlxApp.LAYERTYPE_DRAWING
DlxApp.LAYERTYPE_LIBRARYFRAMES
DlxApp.LAYERTYPE_TOPCOPPER
DlxApp.LAYERTYPE_INNERCOPPER1
DlxApp.LAYERTYPE_INNERCOPPER2
DlxApp.LAYERTYPE_INNERCOPPER3
DlxApp.LAYERTYPE_INNERCOPPER4
DlxApp.LAYERTYPE_INNERCOPPER5
DlxApp.LAYERTYPE_INNERCOPPER6
DlxApp.LAYERTYPE_INNERCOPPER7
DlxApp.LAYERTYPE_INNERCOPPER8
DlxApp.LAYERTYPE_INNERCOPPER9
DlxApp.LAYERTYPE_INNERCOPPER10
DlxApp.LAYERTYPE_INNERCOPPER11
DlxApp.LAYERTYPE_INNERCOPPER12
DlxApp.LAYERTYPE_INNERCOPPER13
DlxApp.LAYERTYPE_INNERCOPPER14
DlxApp.LAYERTYPE_INNERCOPPER15
DlxApp.LAYERTYPE_INNERCOPPER16
DlxApp.LAYERTYPE_BOTTOMCOPPER
DlxApp.LAYERTYPE_PADS
DlxApp.LAYERTYPE_VIAS
DlxApp.LAYERTYPE_HOLES
DlxApp.LAYERTYPE_TOPRESISTMASK
DlxApp.LAYERTYPE_BOTTOMRESISTMASK
DlxApp.LAYERTYPE_TOPPASTEMASK
DlxApp.LAYERTYPE_BOTTOMPASTEMASK
DlxApp.LAYERTYPE_TOPGLUE
DlxApp.LAYERTYPE_BOTTOMGLUE
DlxApp.LAYERTYPE_TOPSILK
DlxApp.LAYERTYPE_BOTTOMSILK
DlxApp.LAYERTYPE_BOARDOUTLINE
DlxApp.LAYERTYPE_KEEPOUT
DlxApp.LAYERTYPE_RATSNEST
DlxApp.LAYERTYPE_TOPMECHANICAL
DlxApp.LAYERTYPE_BOTTOMMECHANICAL
DlxApp.LAYERTYPE_TOPRENDER2D
DlxApp.LAYERTYPE_BOTTOMRENDER2D
DlxApp.LAYERTYPE_TOPCOURTYARD
DlxApp.LAYERTYPE_BOTTOMCOURTYARD
DlxApp.LAYERTYPE_TOPINFO
DlxApp.LAYERTYPE_BOTTOMINFO
DlxApp.LAYERTYPE_BOARDINFO
DlxApp.LAYERTYPE_REFERENCE
DlxApp.LAYERTYPE_TOPCARBONMASK
DlxApp.LAYERTYPE_BOTTOMCARBONMASK
DlxApp.LAYERTYPE_TOPGOLDMASK
DlxApp.LAYERTYPE_BOTTOMGOLDMASK
DlxApp.LAYERTYPE_TOPHEATSINKMASK
DlxApp.LAYERTYPE_BOTTOMHEATSINKMASK
DlxApp.LAYERTYPE_TOPPEELABLEMASK
DlxApp.LAYERTYPE_BOTTOMPEELABLEMASK
DlxApp.LAYERTYPE_TOPSILVERMASK
DlxApp.LAYERTYPE_BOTTOMSILVERMASK
DlxApp.LAYERTYPE_TOPTINMASK
DlxApp.LAYERTYPE_BOTTOMTINMASK
DlxApp.LAYERTYPE_TOPASSEMBLY
DlxApp.LAYERTYPE_BOTTOMASSEMBLY
DlxApp.LAYERTYPE_BOARDMECHANICAL

Return Value

Returns the object corresponding to the layer. Call the IsValid() method to determine if the layer was created correctly.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  page.NewLayer("dimension lines", DlxApp.LAYERTYPE_DRAWING);
}

See also