Adds a via in the PCB.

syntaxSyntax:
DlxPage.DrawVia(position, style, startLayer = DlxApp.LAYERTYPE_TOPCOPPER, stopLayer = DlxApp.LAYERTYPE_BOTTOMCOPPER)

Parameters

Parameter Description
position A DlxPoint object with the location to insert the via.
style A DlxPadStyle object with the style of the via.
startLayer, stopLayer The initial and final layers. Specify one of the following values:
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

Return Value

The newly created DlxVia object. Call the IsValid() method to determine if the object was created correctly.

Remarks

This method fails if the style is not valid to describe a via.

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.GetActivePage();
  if (page.IsValid())
  {
    var padstyle = new DlxPadStyle();
    padstyle.InitPadFromDiameter(1.0, 0.6);
    page.DrawVia(new DlxPoint(100,150), padstyle);
  }
}

See also