Adds a pad in the PCB.
 Syntax:  | 
|---|
| DlxPage.DrawTHPad(position, style, number = "", rotation = 0, toPadOrigin = false) | 
Parameters
| Parameter | Description | 
|---|---|
| position | A DlxPoint object with the location to insert the pad. | 
| style | A DlxPadStyle object with the style of the pad. | 
| number | The number to assign to the pad. | 
| rotation | Specify the rotation in degrees. | 
| toPadOrigin | SMD pads are always positioned relative to the center of the pad. Through-hole pads are positioned relative to the center of the hole unless the toPadOrigin value is true. | 
Return Value
The newly created DlxPad object. Call the IsValid() method to determine if the object was created correctly.
Remarks
This method fails if the style does not describe a through-hole pad.
Example
                    
                         Copy 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.2, 0.8);
    page.DrawTHPad(new DlxPoint(100,150), padstyle, "1");
  }
}
				 | 
			|
