Harness proD API Help
EPLAN.Harness.API Namespace / HpdApi Class / CreateProjectFromTemplate Method
Name of the project.
Path to the template file.
Location of the new project directory.
Example
In This Topic
    CreateProjectFromTemplate Method
    In This Topic
    Create a new HpD project from template.
    Syntax
    public string CreateProjectFromTemplate( 
       string name,
       string templatePath,
       string location
    )

    Parameters

    name
    Name of the project.
    templatePath
    Path to the template file.
    location
    Location of the new project directory.

    Return Value

    Path to the created project.
    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.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    This directory was not found.
    The exception that is thrown when the file has the wrong extension.
    This file was not found.
    Project was not created.
    Example
    This example shows how to create a new project from template.
    // API is already initialized.
    HpdApi api = HpdApi.GetInstance();
    
    string template = @"Path to a template file (*.hxpt)";
    
    string newProjectPath = api.CreateProjectFromTemplate("NewProjectName", template, @"Location...");
    This example shows how to create a new project from template in default project location.
    // API is already initialized.
    HpdApi api = HpdApi.GetInstance();
    
    string template = @"Path to a template file (*.hxpt)";
    
    string newProjectPath = api.CreateProjectFromTemplate("NewProjectName", template);
    See Also