Set the shape of the pad.

syntaxSyntax:
DlxPadStyle.SetShape(layerType, shapeType, height, width, formFactor = 0, corners = "")

Parameters

Parameter Description
layerType The layer on which to apply the pad shape. Specify one of the following values:
DlxApp.LAYERTYPE_ALLPCBLAYERS
DlxApp.LAYERTYPE_TOPCOPPER
DlxApp.LAYERTYPE_BOTTOMCOPPER
DlxApp.LAYERTYPE_ALLINNERCOPPER
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_TOPRESISTMASK
DlxApp.LAYERTYPE_BOTTOMRESISTMASK
DlxApp.LAYERTYPE_TOPPASTEMASK
DlxApp.LAYERTYPE_BOTTOMPASTEMASK
DlxApp.LAYERTYPE_KEEPOUT
shapeType A string with the name of the shape or its handle. The following values are predefined.
DlxApp.PADSHAPE_ROUND The pad takes a circular or ellipsoidal shape depending on the values specified in the fields width and height. The value of the field formFactor is irrelevant and can be zero.
DlxApp.PADSHAPE_SQUARE The pad assumes a square or rectangular shape with blunted angles depending on the values specified in the fields width, height and formFactor. The value of the field formFactor specifies the smoothing percentage of all four corners of the pad.
DlxApp.PADSHAPE_ROUNDED The pad takes a circular, square, rectangular or oblong shape depending on the values specified in the fields width, height and formFactor. The value of the field formFactor specifies the rounding percentage of all four edges of the pad
DlxApp.PADSHAPE_SEMIROUNDED The pad takes a square, rectangular or semi-oblong shape depending on the values specified in the fields width, height and formFactor. The value of the field formFactor specifies the rounding percentage of two of the four edges of the pad.
DlxApp.PADSHAPE_SECTOR The pad takes the form of a circle or ellipse sector depending on the values specified in the fields width, height and formFactor. The value of the field formFactor specifies the width of the sector.
DlxApp.PADSHAPE_SHAPED The basic shape of the pad is a square or a rectangle depending on the values specified in the fields width and height. The corners can be at 90 degrees, beved, sunken, or rounded depending on the format string specified in the corners field. The format string can contain up to 4 characters, each of which describes the shape of a corner starting from the one at the bottom right and continuing counterclockwise. The value of the field formFactor specifies the amplitude of the corner. The characters are as follows:
S: Specifies a 90-degree angle.
B: Specifies a beveled angle.
D: Specifies a rounded angle.
K: Specifies that the angle is sunken at 90 degrees.
O: Specifies that the angle is sunken and rounded.
V: Specifies that the angle extends to the bottom side.
U: Specifies that the angle extends to the right side.
Example: BSBS to bevel the first and fourth corner.
height Specifies the size of the pad on the y-axis.
width Specifies the size of the pad on the x-axis.
formFactor Specifies the percentage of rounding or beveling of all four corners of the pad. When shapeType=DlxApp.PADSHAPE_SHAPED, specifies the amplitude of the corner.
corners Used when shapeType=DlxApp.PADSHAPE_SHAPED, it specifies the corners format string.

Return Value

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

Remarks

LAYERTYPE_ALLPCBLAYERS describes the default shape, i.e. the shape the pad takes for all layers for which no specific shape has been defined. LAYERTYPE_ALLINNERCOPPER describes the shape of the pad for all inner layers.

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

See also