Set the specified point.

DlxCurve.SetPoint(index, point)


Parameter Description
index Point index. The value must be between 0 and GetPointCount()-1.
point A DlxPoint object with the coordinates specifying the point.

Return Value

If the operation ends correctly it returns true otherwise it returns false.


  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 pos = layer.GetFrontObjectIterator();
      while (pos.IsValid())
        var obj = layer.GetNextObject(pos);
        if (obj.GetType() == DlxApp.OBJTYPE_CURVE)
          // Extends the curve.
          var angle = obj.GetPoint(1).ArcAngle(obj.GetStartPoint());
          obj.SetPoint(0, obj.GetStartPoint().CirclePoint(20, angle));
          angle = obj.GetPoint(obj.GetPointCount()-2).ArcAngle(obj.GetEndPoint());
          obj.SetPoint(obj.GetPointCount()-1, obj.GetEndPoint().CirclePoint(20, angle));
          // Set the curve thickness to 2mm.
          var pen = new DlxPenStyle();
          DlxApp.Printf("Curve type: %s", obj.GetCurveType() == DlxApp.CURVETYPE_BEZIER ? "Bezier Spline" : "Cardinal Spline");

See also