Returns the number of layers contained in the page.
Syntax: |
---|
DlxPage.GetLayerCount() |
Return Value
Returns the number of layers contained in the page.
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());
}
}
}
|