API Help
Eplan.EplApi.HEServices Namespace / Masterdata Class / GenerateMacrosFromMacroProject Method / GenerateMacrosFromMacroProject(Project,String,String,String,Boolean) Method
Project from which the macros will be generated.
Specifies output directory for window macros. If empty or null default macro directory is used.
Specifies output directory for window macros. If empty or null default macro directory is used.
Speficies filter scheme. If empty or null no filter is used.
If the output file already exists specifies wheather it should be overwritten.
Example

In This Topic
    GenerateMacrosFromMacroProject(Project,String,String,String,Boolean) Method
    In This Topic
    Generate macros from project. Project must have property "Type of project" set to "Macro project".
    Syntax

    Parameters

    oProject
    Project from which the macros will be generated.
    strWindowMacroDirectory
    Specifies output directory for window macros. If empty or null default macro directory is used.
    strPageMacroDirectory
    Specifies output directory for window macros. If empty or null default macro directory is used.
    strFilterScheme
    Speficies filter scheme. If empty or null no filter is used.
    bOverwriteExistingMacros
    If the output file already exists specifies wheather it should be overwritten.
    Exceptions
    ExceptionDescription
    A parameter was set to a null reference.
    Parameters are invalid, e.g. given project name doesn't exist.
    Internal interface for master data could not be created.
    Macros cannot be exported.
    Used filter scheme name doesn't exist
    Example
    The following examples shows how to use method GenerateMacrosFromMacroProject.
    // Generate macros with specified strWindowMacroDirectory without filter.
    // Page macros will be exported to default Macros directory.
    string strWindowMacroDirectory = Path.Combine(m_oDir.FullName, "Test009d_WindowMacroDir");
    new Masterdata().GenerateMacrosFromMacroProject(oTestProject, strWindowMacroDirectory, null, null, true);
    
    
    // Generate macros with specified strWindowMacroDirectory and strPageMacroDirectory without filter
    strWindowMacroDirectory = Path.Combine(m_oDir.FullName, "Test009d_WindowMacroDir");
    strPageMacroDirectory = Path.Combine(m_oDir.FullName, "Test009d_PageMacroDir");
    new Masterdata().GenerateMacrosFromMacroProject(oTestProject, strWindowMacroDirectory, strPageMacroDirectory, null, true);
    
    
    // Generate macros with specified strFilterName to default Macros directory
    string strFilterName = "page_macros";
    new Masterdata().GenerateMacrosFromMacroProject(oTestProject, null, null, strFilterName, true);
    
    
    See Also