Creates a polyline from a list of vertices.

syntaxSyntax:
DlxLayer.DrawPolyline(vertices)

Parameters

Parameter Description
vertices An array of DlxPoint objects with the coordinates used to create the polyline vertices.

Return Value

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

Remarks

Draws a series of contiguous line segments. Each segment behaves as a separate DlxLine object. however, there is an advantage in creating contiguous line segments rather than a single polyline: each line segment can be modified independently of the other segments of the series.

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 vertices = new Array();
      vertices[0] = new DlxPoint(30,30);
      vertices[1] = new DlxPoint(50,60);
      vertices[2] = new DlxPoint(100,60);
      vertices[3] = new DlxPoint(100,30);
      vertices[4] = new DlxPoint(150,40);
      layer.DrawPolyline(vertices);
    }
  }
}

See also