Gets the number of segments connected to the specified end of the path.

syntaxSyntax:
DlxPath.GetLinkCount(index)

Parameters

Parameter Description
index Specify 0 for the beginning of the path, 1 for the end of the path.

Return Value

Returns the number of segments connected to the specified end of the path.

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