Adds a copper area in the PCB.

DlxLayer.DrawCopper(rect, rotAngle = 0)
DlxLayer.DrawCopper(points, slotWidth = 0)
DlxLayer.DrawCopper(center, sizex, sizey = 0, rotAngle = 0)


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 DlxCopper object. Call the IsValid() method to determine if the object was created correctly.


  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 layer = page.GetLayerFromType(DlxApp.LAYERTYPE_TOPCOPPER);
    if (layer.IsValid())
      var points1 = new Array();
      points1[0] = new DlxPoint(90, 120);
      points1[1] = new DlxPoint(100, 130);
      points1[2] = new DlxPoint(110, 120);

      var points2 = new Array();
      points2[0] = new DlxPoint(90, 130);
      points2[1] = new DlxPoint(100, 140);
      points2[2] = new DlxPoint(110, 130);
      layer.DrawCopper(points2, 3);
      layer.DrawCopper(new DlxRect(40,120,70,160), 0);
      layer.DrawCopper(new DlxPoint(140,140), 20);

See also