Returns the specified layer.
Parameters
Parameter |
Description |
index |
The index of the layer. The index must be in the range:
0 .. GetLayerCount()-1. |
Return Value
Returns the object corresponding to the layer. Call the IsValid() method to determine if the object 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 count = page.GetLayerCount();
for (var i = 0; i < count; i++)
{
DlxApp.Printf("layer %i = %s", i, page.GetLayer(i).GetName());
}
}
}
|
See also