Harness proD API Help
EPLAN.Harness.API Namespace / HpdApi Class / OpenProject Method
Path to the HpD project file
In This Topic
    OpenProject Method
    In This Topic
    Open a HpD project.
    Syntax
    public Project OpenProject( 
       string filename
    )

    Parameters

    filename
    Path to the HpD project file

    Return Value

    Project object
    Exceptions
    ExceptionDescription
    Only one project can be opened at a time. Close CurrentProject and try it again.
    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.
    Unexpected error in HpD.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    This file was not found.
    File you are trying to open is locked by another user.
    Document was saved with an unsupported version of HpD.
    The exception that is thrown when the file has the wrong extension.
    Remarks

    If any problem occurs when connecting to the project's active library (for example: wrong version of library) the library will be disconnected. Check project's property EPLAN.Harness.API.Projects.Documents.Project.ActiveConnection if isn't a null reference (Nothing in Visual Basic). For detailed information about what was wrong, see the LOG file or try reconnecting the library using EPLAN.Harness.API.Projects.Documents.Project.ConnectToLibrary. You'll then get the relevant exception.

    See Also