Gets the object identified by the iterator, then sets the iterator to the previous object in the layer.

syntaxSyntax:
DlxLayer.GetPrevObject(iterator)

Parameters

Parameter Description
iterator A DlxIterator value returned by a previous GetPrevObject, GetBackObjectIterator, or other function call.

Return Value

Returns the DlxObject corresponding to the iterator. 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())
    {
      layer.DrawText(new DlxPoint(90,100), "Hello, World.");
      layer.DrawLine(new DlxPoint(30, 30), new DlxPoint(80, 80));
      layer.DrawShape("V90,110,0;V110,130,0;V130,110,0;V90,110,-120;");
      var pos = layer.GetBackObjectIterator();
      while (pos.IsValid())
      {
        var obj = layer.GetPrevObject(pos);
        DlxApp.Printf("object type: %s", obj.GetTypeName());
      }
    }
  }
}

See also