Creates a Bézier spline.

syntaxSyntax:
DlxLayer.DrawBezier(p1, pc1, pc2, p2)

Parameters

Parameter Description
p1 A DlxPoint object with the coordinates of the starting point of the Bézier spline.
pc1 A DlxPoint object with the coordinates of the first control point of the Bézier spline.
pc2 A DlxPoint object with the coordinates of the second control point of the Bézier spline.
p2 A DlxPoint object with the coordinates of the ending point of the Bézier spline.

Return Value

The newly created DlxCurve 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())
    {
      layer.DrawBezier(new DlxPoint(30, 30), new DlxPoint(80, 45), new DlxPoint(35, 65), new DlxPoint(80, 90));
    }
  }
}

See also