Adds a new page to the document.

syntaxSyntax:
DlxGraphixDocument.NewPage(name, position, select)

Parameters

Parameter Description
name The name of the page.
position Adds a new page to the document. Position 1 indicates the first page. Specify -1 to add the new page as the last page of the document.
select If you specify true, the page becomes the active page.

Return Value

Returns the object corresponding to the page. 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())
{
  doc.OpenPageManagementUndo();
  doc.NewPage("page 2", 0, true);
  doc.NewPage("page 1", 0, true);
  doc.ClosePageManagementUndo();
}
DlxApp.Printf("Pages: %i", doc.GetPageCount());

See also