Returns the object corresponding to the document identified by the specified name.

syntaxSyntax:
DlxFolder.GetDocument(name, type)

Parameters

Parameter Description
name The document name.
type The document type. Specify one of the following values.
Value Meaning
DlxApp.DOCTYPE_UNKNOWN Any type of document.
DlxApp.DOCTYPE_DRAWING Drawing document.
DlxApp.DOCTYPE_SCHEMATIC Schematic document.
DlxApp.DOCTYPE_PCB PCB document.
DlxApp.DOCTYPE_LIBRARY Components library.
DlxApp.DOCTYPE_SCRIPT Script source text.
DlxApp.DOCTYPE_SPICECIR SPICE circuit.
DlxApp.DOCTYPE_SPICELIB SPICE Library.
DlxApp.DOCTYPE_TEXTRTF RTF text document.
DlxApp.DOCTYPE_TEXT Text document.
DlxApp.DOCTYPE_HTML HTML text document.

Return Value

Returns the object corresponding to the document. Call the IsValid() method to determine if the object is valid.

Example

  Copy codeCopy code
var folder = DlxApp.GetJob().GetFolder("folder1");
if (folder.IsValid())
{
  var doc = folder.GetDocument("sch1", DlxApp.DOCTYPE_SCHEMATIC);
}
if ((!doc) || (!doc.IsValid()))
  throw new Error("Document not found.");
DlxApp.Printf("Document found.");

See also