Gets the path attached to the specified endpoint.

syntaxSyntax:
DlxPath.GetLinkedPath(index, objIndex)

Parameters

Parameter Description
index Specify 0 for the beginning of the path, 1 for the end of the path.
objIndex Path index. The value must be between 0 and GetLinkCount()-1.

Return Value

Returns the DlxPath corresponding to the index. Call the IsValid() method to determine if the object is valid.

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())
    {
      var pen = new DlxPenStyle(0.5, new DlxColor("orangered"));
      doc.SetStyle(pen);  
      var brush = new DlxBrushStyle("beige");  
      doc.SetStyle(brush);

      var obj0 = layer.DrawPath(new DlxPoint(100, 30), new DlxPoint(100, 90), 3, DlxApp.PATHCAP_ROUND, DlxApp.PATHCAP_ARROW, true);
      var obj1 = layer.DrawPath(new DlxPoint(100, 90), new DlxPoint(60, 140), 3, DlxApp.PATHCAP_ROUND, DlxApp.PATHCAP_ARROW, true);
      var obj2 = layer.DrawPath(new DlxPoint(100, 90), new DlxPoint(140, 140), 3, DlxApp.PATHCAP_ROUND, DlxApp.PATHCAP_ARROW, true);
      obj1.SetName("obj1");
      obj2.SetName("obj2");

      DlxApp.Printf("Count = %i", obj0.GetLinkCount(1));
      for (var i = 0; i < obj0.GetLinkCount(1); i++)
      {
        DlxApp.Printf("Link%i : %s", i, obj0.GetLinkedPath(1, i).GetName());
      }
    }
  }
}

See also