Returns the iterator that can be used for iteration or layer retrieval.
Syntax: |
---|
DlxView.GetLayerIterator() |
Return Value
A DlxIterator value that can be used for iteration or layer retrieval; Call the IsValid() method to determine if the iterator 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())
{
DlxApp.Printf("The page %s consists of %i layers.", page.GetName(), page.GetLayerCount());
var i = page.GetLayerIterator();
while (i.IsValid())
{
var layer = page.GetNextLayer(i);
DlxApp.Printf("layer: %s", layer.GetName());
}
}
}
|