Sets the parameters of the hole.

syntaxSyntax:
DlxPadStyle.SetHole(diameter = 0, plated = true, holeOffsetX = 0, holeOffsetY = 0, slotLength = 0, slotAngle = 0)

Parameters

Parameter Description
diameter Specify the diameter of the hole. The hole diameter may be larger than the pad diameter to define holes without a copper ring. Specify zero for pads without hole.
plated Specify the hole type. Enter true if the hole is plated otherwise false.
holeOffsetX Specify the horizontal offset of the hole to the center of the pad.
holeOffsetY Specify the vertical offset of the hole from the center of the pad.
slotLength To create a slot with rounded ends, specify its length.
slotAngle Specify the direction of the slot in degrees.

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.SetShape(DlxApp.LAYERTYPE_ALLPCBLAYERS, DlxApp.PADSHAPE_ROUNDED, 1.5, 2.0, 0.5);
      padstyle.SetHole(0.5, true, -0.45, -0.25, 1, 30);
      layer.DrawPad(new DlxPoint(100,150), padstyle, "1");
    }
  }
}

See also