EPLAN.EPLAN21.DWG_EXTERN.EXPORT

Contents

Description

Command for exporting projects or pages into the AutoCAD DWG format by using a subsequent external process. The corresponding settings for the conversion must have already been made in EPLAN 21.

The EPLAN.EPLAN21.DWG_EXTERN.EXPORT command is called up via the API functions as specified in the EPLAN 21 API.

Parameters

All parameters have the prefix "EPL_PARAM_ACAD_EXPORT_".

ParameterID Type Description
PROJECT [IN, OPTIONAL]
EplHandle
Handle to a project that is to be exported into DXF format.
PROJECTS [IN, OPTIONAL]
EplHandle
Handle to a project iterator with projects that are to be exported.
PAGE [IN, OPTIONAL]
EplHandle
Handle to a page that is to be exported.
PAGES [IN, OPTIONAL]
EplHandle
Handle to a page iterator with pages that are to be exported.
FILENAME [IN, INDEX]
String
Path name of the file/s into which the export is to be carried out. Index 0 is to contain the number of valid entries of the parameter, which follow index 0.

Error Messages

The eplExecuteCommand function returns EPL_OK if the objects could be successfully exported.

If the command fails, eplExecuteCommand returns the value EPL_ERROR. In this case, the error log can contain the following errors:

ErrorID Description
EPL_ERR_FAILED The export could not be carried out. A fatal error occurred.
EPL_ERR_INVALID_ARGUMENT No suitable parameter (PROJECT, PROJECTS, PAGE, PAGES) was handed over.

Example

The following example shows a function which exports a page into a file. The handle to the page object and the file name of the export file must be determined first.

bool
exportPage(EplSession hSession, EplHandle hPage, wchar* wcsFilename)
{
    bool bRet(eplFALSE);

    //Create EXPORT.DXF command
    EplHandle hCmdExportDxf = eplCreateCommand(hSession, L"EPLAN.EPLAN21.DWG_EXTERN.EXPORT");

    if(hCmdExportDxf != EPL_ERROR)
    {
        //Set parameters
        //
        //Page handle
        eplSetHandleParam(hSession,
                          hCmdExportDxf,
                          EPL_PARAM_ACAD_EXPORT_PAGE,
                          hPage,
                          0);

 	//Set number of file names [index is 0]
        eplSetParam(hSession,
                    hCmdExportDxf,
                    EPL_PARAM_ACAD_EXPORT_FILENAME,
                    "1"
                    0);

        //Set file names [index is 1]
        eplSetParam(hSession,
                    hCmdExportDxf,
                    EPL_PARAM_ACAD_EXPORT_FILENAME,
                    wcsFilename,
                    1);

        //Execute command
        if(eplExecuteCommand(hSession, hCmdExportDxf) != EPL_ERROR;
        {
            bRet = eplTRUE;
        }

        eplCloseObject(hSession, hCmdExportDxf);
    }

    return bRet;
}

Reference