Creates a cardinal spline from a list of vertices.

syntaxSyntax:
DlxLayer.DrawCurve(vertices)

Parameters

Parameter Description
vertices An array of DlxPoint objects that specify the coordinates that the cardinal spline passes through.

Return Value

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

Remarks

A segment is defined as a curve that connects two consecutive points in the cardinal spline. The ending point of each segment is the starting point for the next.

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.DrawCurve(vertices);
    }
  }
}

See also