Harness proD API Help
EPLAN.Harness.API Namespace / Library Class / CreateXmlLibrary Method
The name of the library being created.
Path to the directory where to save the file-system-based library.
Password for the library. If null, the library is not protected by any password.
Example
In This Topic
    CreateXmlLibrary Method
    In This Topic
    Create new file-system-based library.
    Syntax

    Parameters

    libraryName
    The name of the library being created.
    directoryPath
    Path to the directory where to save the file-system-based library.
    password
    Password for the library. If null, the library is not protected by any password.

    Return Value

    Connection to the created XML library.
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it.
    This directory was not found.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Argument is null.
    The exception that is thrown when the file has the wrong extension.
    The operation was not successful.
    Remarks

    After this method is called the new file-system-based library is only created, not connected.

    If connection is required use the ConnectToLibrary(BaseLibraryConnection,String,Boolean) method and pass it the returned library connection.

    Example
    This example shows how to create new file-system-based library. The created library is not protected with a password.
    Library library = Library.GetInstance();
    
    library.CreateXmlLibrary("library name", @"directory path");
    This example shows how to create new password protected file-system-based library.
    Library library = Library.GetInstance();
    
    library.CreateXmlLibrary("library name", @"directory path", "password");
    This example shows how to create new file-system-based library and connect to it.
    Library library = Library.GetInstance();
    
    XmlLibraryConnection connection = library.CreateXmlLibrary("library name", @"directory path");
    library.ConnectToLibrary(connection);
    See Also