Creates a leader line based on the provided coordinates.

syntaxSyntax:
DlxLayer.DrawLeader(vertices, text)

Parameters

Parameter Description
vertices An array of DlxPoint objects with the coordinates specifying the leader. You must provide at least two points to define the leader. The third point is optional.
text The text string.

Return Value

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

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  if (page.IsValid())
  {
    var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
    if (layer.IsValid())
    {
      var style = new DlxLeaderStyle(DlxApp.STYLE_DEFAULT);
      doc.SetStyle(style);
      var vertices = new Array();
      vertices[0] = new DlxPoint(30,30);
      vertices[1] = new DlxPoint(50,50);
      vertices[2] = new DlxPoint(70,50);
      layer.DrawLeader(vertices, "Hello, World.");     
    }
  }
}

See also