Returns a value indicating the type of curve.
Return Value
Returns one of the following values:
DlxApp.CURVETYPE_BEZIER |
DlxApp.CURVETYPE_CARDINAL |
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", 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();
obj.GetStyle(pen);
pen.SetWidth(2);
obj.SetStyle(pen);
DlxApp.Printf("Curve type: %s", obj.GetCurveType() == DlxApp.CURVETYPE_BEZIER ? "Bezier Spline" : "Cardinal Spline");
}
}
}
}
}
|
See also