Creates a frame. Frame objects are used to define symbols and footprints.

syntaxSyntax:
DlxPage.DrawFrame(rect, number, name = "", info = ")

Parameters

Parameter Description
rect A DlxRect object that specifies the frame rectangle.
number A string that specifies the part number.
name A string that specifies the name to assign to the symbol.
info A string with a brief description of the symbol.

Return Value

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

Remarks

The object is created on the Library Frames (DlxApp.LAYERTYPE_LIBRARYFRAMES) layer. If the layer is not present on the page, the object is not created and this function returns an invalid object.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Footprints");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Footprints");
var pcbDoc = prj.NewDocument("Examples Footprints", DlxApp.DOCTYPE_PCB);
if (pcbDoc.IsValid() && pcbDoc.Activate())
{
  // Initialize the document
  pcbDoc.SetPageFormat("A4", true);
  var page = pcbDoc.NewPage("DIP14", 0, true);
  page.SelectView("Default View");
  if (page.LoadLayerStack("footprints library layer stack.clxlys"))
  {
    // Draw the frame
    var hotspotPoint = new DlxPoint(105, 150);
    page.DrawFrame(new DlxRect(10,10,200,290), 1, "DIP14", "Dual-in-line 14 leads.");
    page.DrawHotspot(hotspotPoint);
    var body = new DlxRect();
    body.SetCentered(hotspotPoint, 4.5, 18);
    page.DrawReference(body.TopLeft(), "U?", 0, DlxApp.TEXTALIGN_BOTTOMLEFT);
    page.DrawValue(body.BottomLeft(), "Value", 0, DlxApp.TEXTALIGN_TOPLEFT);
  }
}

See also