Set the shape of the pad.
Syntax: |
|
DlxPadStyle.SetPolygonShape(layerType, height, width, sides, rotation = 0)
|
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 |
|
| height |
Specifies the size of the pad on the y-axis. |
| width |
Specifies the size of the pad on the x-axis. |
| sides |
The number of sides of the polygon. |
| rotation |
Specify the rotation of the shape in degrees. |
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 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.SetPolygonShape(DlxApp.LAYERTYPE_ALLPCBLAYERS, 1.5, 2.0, 6, 0);
layer.DrawPad(new DlxPoint(100,150), padstyle, "1");
}
}
}
|
See also