Adds a cutout in the PCB.

syntaxSyntax:
DlxPage.DrawCutout(shape)
DlxPage.DrawCutout(shapeDef)
DlxPage.DrawCutout(rect, rotAngle = 0)
DlxPage.DrawCutout(points, slotWidth = 0)
DlxPage.DrawCutout(center, sizex, sizey = 0, rotAngle = 0)

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.

Return Value

The newly created DlxCutout object. Call the IsValid() method to determine if the object was created correctly.

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.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.DrawCutout(points1);

    var points2 = new Array();
    points2[0] = new DlxPoint(90, 130);
    points2[1] = new DlxPoint(100, 140);
    points2[2] = new DlxPoint(110, 130);
    page.DrawCutout(points2, 3);
    page.DrawCutout("V80,160,0;V95,180,0;V110,160,0;V80,160,-120;");
    page.DrawCutout(new DlxRect(40,120,70,160), 0);
    page.DrawCutout(new DlxPoint(140,140), 20);
  }
}

See also