Adds a keepout area in the PCB.
Syntax: |
---|
DlxPage.DrawKeepout(shape, mode = DlxApp.KEEPOUT_ALL) DlxPage.DrawKeepout(shapeDef, mode = DlxApp.KEEPOUT_ALL) DlxPage.DrawKeepout(rect, rotAngle = 0, mode = DlxApp.KEEPOUT_ALL) DlxPage.DrawKeepout(points, slotWidth = 0, mode = DlxApp.KEEPOUT_ALL) DlxPage.DrawKeepout(center, sizex, sizey = 0, rotAngle = 0, mode = DlxApp.KEEPOUT_ALL) |
Parameters
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
shape | A DlxFigure object with the shape. | ||||||
shapeDef | String with the definition of the copper shape. For more information, see Shape Format Specifications. | ||||||
rect | A DlxRect object that specify the copper rectangle. | ||||||
rotAngle | The angle, in degrees, of rotation of the copper with respect to the x-axis. | ||||||
points | Arrays of DlxPoint objects with coordinates of the polygon vertices. | ||||||
slotWidth | If greater than zero, the vertices specified in points define a slot whose width is defined by slotWidth. If equal to zero the vertices defined in points define a polygon. | ||||||
center | A DlxPoint object with the coordinates specifying the center of the ellipse. | ||||||
sizex | A positive value that defines the radius of the circle or the half length of the x-axis of the ellipse. | ||||||
sizey | A positive value defining the half length of the y-axis of the ellipse. If zero is specified, sizey is set equal to sizex. | ||||||
mode | Specify a combination of the following values:
|
Return Value
The newly created DlxKeepout object. Call the IsValid() method to determine if the object was created correctly.
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 points1 = new Array();
points1[0] = new DlxPoint(90, 120);
points1[1] = new DlxPoint(100, 130);
points1[2] = new DlxPoint(110, 120);
page.DrawKeepout(points1);
var points2 = new Array();
points2[0] = new DlxPoint(90, 130);
points2[1] = new DlxPoint(100, 140);
points2[2] = new DlxPoint(110, 130);
page.DrawKeepout(points2, 3);
page.DrawKeepout("V80,160,0;V95,180,0;V110,160,0;V80,160,-120;");
page.DrawKeepout(new DlxRect(40,120,70,160), 0);
page.DrawKeepout(new DlxPoint(140,140), 20);
}
}
|