Keyword Index

Object: DWLibrary

  • close - Close the library, if it's open, otherwise do nothing.
  • DWLibrary - Create a library object and associate it with a new or existing symbol library file.
  • exists - Indicates whether the specified library file exists.
  • fileDir - The directory path of the file associated with this circuit, i.e. the name of the directory containing the file. Read only.
  • fileName - The name of the file associated with this circuit, i.e. the file name without any directory path. Read only.
  • filePath - The full directory path and file name of the file associated with this circuit. Read only.
  • libID - Gets the libID (a unique integer identifier used to select an entire library or a symbol from a library). If this is zero, this library has no libID, i.e. it may not have been created or saved yet.
  • loadType - Loads a device type definition from the library
  • objType - Returns a string with the name of this object class "DWLibrary".
  • open - Opens the library, optionally specifying a new library file. If the given library does not exist, a new, empty library is created
  • readOnly - Indicates whether the specified library file is read only.
  • readOnly - Returns true if the library file is marked "read only" by the file system.
  • saveType - Saves a device type definition to the library
  • title - Gets or sets the user-friendly title for this library
  • typeList - Gets a list of the all types stored in the library
  • Method: close

    Close the library, if it's open, otherwise do nothing.

    bool = close

    Returns:

    Returns false if the library file is open and cannot be closed, true otherwise.

    Method: DWLibrary

    Create a library object and associate it with a new or existing symbol library file.

    DWLibrary DWLibrary(fileName);

    DWLibrary DWLibrary(fileName, hidden);

    Parameters
    Name Expected Type Description
    fileName String The name of the field to retrieve
    hidden bool true to open the library without making it visible to the user, defaults to false

    Returns:

    Returns a DWLibrary object.

    Remarks:

    This creates a new DWLibrary script object and associates the given file name with it. At the time of this call, no attempt is made to open or create an actual library file. This is not done until another method (e.g. loadType) is called that requires it. This means that this call succeeds and returns an object even if the file does not exist and cannot be created using the given name information.

    When an actual file is required, this method first attempts to open the file using the given file name string as a complete path name. If that fails, it then looks through all currently open library files and sees if the given name matches one of them. If that fails, a new library is created using the given name as a complete file path. If that fails, an exception is generated.

    Property: exists

    Indicates whether the specified library file exists.

    bool = exists

    Returns:

    Returns false if the library file cannot be located, true otherwise.

    Property: fileDir

    The directory path of the file associated with this circuit, i.e. the name of the directory containing the file. Read only.

    String fileDir();

    Property: fileName

    The name of the file associated with this circuit, i.e. the file name without any directory path. Read only.

    String fileName();

    Property: filePath

    The full directory path and file name of the file associated with this circuit. Read only.

    String filePath();

    Property: libID

    Gets the libID (a unique integer identifier used to select an entire library or a symbol from a library). If this is zero, this library has no libID, i.e. it may not have been created or saved yet.

    int libID();

    Remarks:

    The lib ID is determined by the library manager at runtime and is not a permanent property of this library.

    Method: loadType

    Loads a device type definition from the library

    DWType loadType(name);

    Parameters
    Name Expected Type Description
    name String The name of the type to load (i.e. as it appears in the parts listing in the Parts Palette

    Returns:

    A DWType object if successful, or null if unsuccessful.

    Property: objType

    Returns a string with the name of this object class "DWLibrary".

    String = objType

    Method: open

    Opens the library, optionally specifying a new library file. If the given library does not exist, a new, empty library is created

    bool = open

    bool = open(path);

    Parameters
    Name Expected Type Description
    path String The file name and path for the library file. If a relative path is given, the usual rules are applied to try and locate it.

    Returns:

    Returns true if the library file was opened successfully, false otherwise

    Property: readOnly

    Indicates whether the specified library file is read only.

    bool = readOnly

    Property: readOnly

    Returns true if the library file is marked "read only" by the file system.

    bool = readOnly

    Method: saveType

    Saves a device type definition to the library

    void saveType(type);

    void saveType(type, dateStamp);

    Parameters
    Name Expected Type Description
    dateStamp bool Optional argument that specifies whether to update the datestamp that is stored with the type. The default is TRUE. This is usually set to TRUE if this type is new or has been modified in any way from its last saved definition. This would be FALSE only to copy a type from one place to another with no changes.
    type DWType The type to save. This must be a DWType object.

    Property: title

    Gets or sets the user-friendly title for this library

    title = String

    String title();

    Method: typeList

    Gets a list of the all types stored in the library

    array = typeList

    Returns:

    An SPArray of DWType objects. The number of objects returned can be determined from the value of array.length