Initialize the style to define a through-hole pad.

syntaxSyntax:
DlxPadStyle.InitTHPadStack(holeDiameter, padDiameter=0, bSquared=false, shapeFactor=0, bPlated=true, padType=DlxApp.PADTHTYPE_PAD, xFactor=0, IPClevel=-1)

Parameters

Parameter Description
holeDiameter Specify the hole diameter.
padDiameter Specify the diameter of the pad. If this value is less than or equal to zero it is calculated from the hole value.
bSquared Specify true if the pad should be square or false for a circular pad.
shapeFactor Specify the shape of the pad by defining whether the corners should be straight, rounded or beveled. Specify the shape of the pad as follows:
>0 and <=1 Corners are rounded. The value of shapeFactor specifies the rounding percentage of all four edges of the pad.
=0 Angles are 90 degrees.
>=-1 and < 0 The corners are beveled. The value of the shapeFactor specifies the percentage of bevel of all four corners of the pad.
bPlated Specify the hole type. Enter true if the hole is plated otherwise false.
padType Specify the type of pad. It can be one of the following values: DlxApp.PADTHTYPE_PAD, DlxApp.PADTHTYPE_HOLE, DlxApp.PADTHTYPE_VIA.
xFactor Determines the increase in size along the X axis of the pad with respect to the Y axis. If you specify a value of 1 then the pad will have twice the width of the height.
IPClevel Specify the board construction level according to IPC-7351 specifications for the three-level library system. Specify one of the following values or -1 to use the default value:
DlxApp.IPCLEVEL_A
DlxApp.IPCLEVEL_B
DlxApp.IPCLEVEL_C

Return Value

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

Remarks

This function creates a public pad style.

NotaNote:

If there is a style matching the specified parameters, the function does not create a new style but uses the existing style.

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.InitTHPadStack(1.2);
      layer.DrawPad(new DlxPoint(100,150), padstyle, "1");
    }
  }
}

See also