API Help
EPLAN API / API Reference / Actions / import
import
Action for importing projects, macros, and drawings. The following functions are supported: 
        • Import PXF project 
        • Import DXF/DWG drawings in macros (The import is not made via the project, but the DXF/DWG files are directly imported from a directory into the macros and stored in a directory.
        • Insert DXF / DWG drawing into a page

Parameter Description

TYPE

Type of task to be performed by the action:PXFPROJECT:Import PXF projectDXFDWGFILES:Insert DXF / DWG drawings in macros.DXFPAGE: Insert DXF drawing into a pageDWGPAGE:Insert DWG drawing into a pagePDFCOMMENTS: Import PDF comments into project.
There are some settings that need to be set before doing import. 
For more informations please see EPLAN Electric P8 Help.

PROJECTNAME

Project name with full path.Is required for the following values of the TYPE parameter: PDFCOMMENTS.
Is optional if the TYPE parameter has the following values: PXFPROJECT, DXFDWGFILES, DXFPAGE and DWGPAGE. 
If not entered, the selected project is used when the action is called from GUI (like from a script or button bar).
If called from the windows command line, PROJECTNAME must be set or the  must be used first, otherwise an  exception is thrown. 

IMPORTFILE

Path and name.
PXFPROJECT: Path and name of the file to be imported.DXFPAGE,DWGPAGE,PDFCOMMENTS: Path and name of the file to be imported.

SOURCEPATH

Directory where the DXF/DWG files are located. Only applies to the DXFDWGFILES value of the TYPE parameter

DESTINATIONPATH

Destination directory where the imported projects and macros are stored. 
Only applies to the DXFDWGFILES values of the TYPE parameter.
If this value contains "EPLAN4\P" (e.q. "C:\EPLAN4\P\SOMEPROJECTDIR") then such a directory (DESTINATIONPATH) will be created and project will be imported there. 
If DESTINATIONPATH parameter doesn't contain "EPLAN4\P", then project will be imported and strDestinationPath will be treated as full project path. 
Note that in such case DESTINATIONPATH must contain P8 project file at end of path. (e.q. "C:\test\ESS_Sample_Project.elk") 

IMPORTSCHEME

Name of the DXF/DWG import scheme (only name, without full path). 
(optional) Default wert= Most recently used scheme. 
If this parameter does not exist or is empty (""), the most recently used scheme is taken. 
Only applies to the TYPE parameter values: DXFPAGE, DWGPAGE, DXFDWGFILES

PAGENAME

Name of page into which the CAD drawing is to be inserted. 
Only applies to the DXFPAGE and DWGPAGE values of the TYPE parameter

XSCALE

Scaling in X direction. 
Default value=1. 
Only applies to the DXFPAGE and DWGPAGE values of the TYPE parameter. (optional)

YSCALE

Scaling in Y direction. 
Default value=1. 
Only applies to the DXFPAGE and DWGPAGE values of the TYPE parameter. (optional)

XOFFSET

Move to X direction. 
Default value=0. 
Only applies to the DXFPAGE and DWGPAGE values of the TYPE parameter. (optional)

YOFFSET

Move to Y direction. 
Default value=0. 
Only applies to the DXFPAGE and DWGPAGE values of the TYPE parameter. (optional)

MACROPROJECT

Full path of new macro project with file extension *.elk. 

ONLYMACROPROJECT

Boolean parameter. 
1: Only create macro project. 
0: automatic export of all macros from created project to macro directory. 
Default: 0. 
(optional)

CODEPAGE

Default value = 437.

DRIVE

SOURCEMACROPATH

The value must be uppercase and the macro must be located at the path: (drive):\EPLAN4\M\.

BALANCEARTICLES

Synchronization of imported parts data with database.
Default: 0. (optional)

GENERATEAUTOMATICCABLES

Indicates whether automatic cables are generated.
Default: 0. (optional)

DESTINATIONFILE

Destination path with file name. 

VERIFY

Indicates whether a project check is started after the import (0 or 1).
Default = 0 (optional).

Example
Import PXF project:

import /TYPE:PXFPROJECT /IMPORTFILE:C:\Projects\ESS_Sample_Project.epj /PROJECTNAME:C:\Projects\EPLAN\ESS_Sample_Project.elk

Import DXF / DWG drawings in macros

import /TYPE:DXFDWGFILES /PROJECTNAME:C:\Projects\EPLAN\ESS_Sample_Project.elk /SOURCEPATH:C:\Projects\DXF_DWG /DESTINATIONPATH:C:\Macros

Insert DXF / DWG drawing into a page:

import /TYPE:DWGPAGE /PROJECTNAME:C:\Projects\EPLAN\ESS_Sample_Project.elk /PAGENAME:=AP+ST1/4 /IMPORTFILE:C:\Projects\EPLAN\DXF_DWG\pline_1.dwg /XSCALE:0.5 /YSCALE:0.5 /XOFFSET:100.0 /YOFFSET:100.0