Create a hotspot object. Hotspot objects must be used to specify the point of insertion (or origin) of symbols and footprints.

syntaxSyntax:
DlxPage.DrawHotspot(point)

Parameters

Parameter Description
point A DlxPoint object with the coordinates specifying the location of the footprint origin.

Return Value

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

Remarks

The object is created on the Top Courtyard (DlxApp.LAYERTYPE_TOPCOURTYARD) 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