Gets the start point.
Syntax: |
---|
DlxLeader.GetPosition() |
Return Value
If the operation is successful, it returns a DlxPoint with the coordinates of the point where the leader's arrow is positioned; otherwise it returns an invalid point. Use IsValid to verify that the point is valid.
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 style = new DlxLeaderStyle("diagram measurements");
doc.SetStyle(style);
var vertices = new Array();
vertices[0] = new DlxPoint(30,30);
vertices[1] = new DlxPoint(50,50);
vertices[2] = new DlxPoint(70,50);
var obj = layer.DrawLeader(vertices, "Hello, World.");
var newpos = new DlxPoint(50, 90);
obj.Move(newpos.x-obj.GetPosition().x, newpos.y-obj.GetPosition().y);
}
}
}
|