Initialize the style to define a via.

syntaxSyntax:
DlxPadStyle.InitViaFromHole(holeDiameter, IPClevel = DlxApp.IPCLEVEL_B)

Parameters

Parameter Description
holeDiameter Specify the hole diameter.
IPClevel Specify the board construction level according to IPC-7351 specifications for the three-level library system. Specify one of the following values:
DlxApp.IPCLEVEL_A
DlxApp.IPCLEVEL_B
DlxApp.IPCLEVEL_C

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 layer = page.GetLayerFromType(DlxApp.LAYERTYPE_TOPCOPPER);
    if (layer.IsValid())
    {  
      var padstyle = new DlxPadStyle();
      padstyle.InitViaFromHole(0.6);
      layer.DrawPad(new DlxPoint(100,150), padstyle, "1");
    }
  }
}

See also