Adds a vertex to the shape.
Syntax: |
---|
DlxFigure.AddPoint(x, y) DlxFigure.AddPoint(point, arcFactor = 0) |
Parameters
Parameter | Description |
---|---|
x | x-coordinate of the point. |
y | y-coordinate of the point. |
point | A DlxPoint object with the coordinates specifying the point. |
arcFactor | The value of this parameter specifies the amplitude of the angle formed by the arc that joins the last vertex of the shape with the vertex specified by point. The value is in degrees and must be zero to specify a straight line segment. Positive values mean the arc is drawn counterclockwise. |
Return Value
If the operation ends correctly it returns true otherwise it returns false.
Example
Copy 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", true);
}
if (doc.IsValid() && doc.Activate())
{
var page = doc.GetActivePage();
if (page.IsValid())
{
var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
if (layer.IsValid())
{
// draw shape
layer.DrawShape("V90,110,0;V110,130,0;V130,110,0;V90,110,-120;");
// draw shape
var andShape = layer.DrawShape();
var figure = andShape.GetFigure();
figure.BeginShape();
figure.AddPoint(new DlxPoint(95,153.75));
figure.AddPoint(new DlxPoint(101.25,153.75));
figure.AddPoint(new DlxPoint(101.25,146.25), -180);
figure.AddPoint(new DlxPoint(95,146.25));
figure.EndShape(true);
}
}
}
|