To disconnect a component.

syntaxSyntax:
DlxSelection.Disconnect()

Return Value

If the operation ends correctly, it returns true otherwise it returns false.

Remarks

The necessary but not sufficient condition to realize a physical connection between two electrical terminals is that they are physically in contact or that the coordinates of the end points coincide. The simple overlapping of the electrical terminals does not make the connection but it is necessary that the objects have been actually connected. The connection between the electrical objects is made automatically during the creation and positioning of the objects. If the objects are already positioned in the schematic, the connection must be made explicitly.

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 p1 = new DlxPoint(60,60);
      var p2 = new DlxPoint(120,60);
      var p3 = new DlxPoint(120,120)
      var w1 = layer.DrawWire(p1, p2, true);
      var w2 = layer.DrawWire(p2, p3, true);

      var sel = page.GetSelection();
      sel.Empty();
      sel.AddObject(w1);
      sel.Disconnect();
    }
  }
}

See also