This functionality is only available for certain module packages.

You are here: Reference > Commands > ECAD.GenerateMacroAndEdzForEcadProjectCommand

ECAD.GenerateMacroAndEdzForEcadProjectCommand

By using the command data are packed into an EDZ file whose contents represent a part for the P8 parts database. To this purpose a macro is generated and packed together with further information and files into an EDZ file.

Requirements:

The following parameters / model variables are important:

Name Type Installed in Standard Meaning
Disciplines > ECAD > EPLAN Electric P8 > Name of the parameter for a C# script String WiringDiagram Script Stores the path to the C# script.
Disciplines > ECAD > EPLAN Electric P8 > Name of the parameter for C# script arguments String WiringDiagram ScriptArguments Stores arguments that are passed to the C# script.
Disciplines > ECAD > EPLAN Electric P8 > EPLAN Data Zip (.edz) generation > Macro project template String Template\$(EPLAN_VERSION_SHORT)\IEC_bas001.zw9 Basic project template for generating the EDZ data.
Disciplines > ECAD > EPLAN Electric P8 > EPLAN Data Zip (.edz) generation > Parameter name for the image path Map Page Image path Stores the source and target paths of the images. The path is specified either absolutely or relatively to the P8 directory for images. While the EDZ file is being imported into P8 the image is stored in a directory that is made up of the P8 directory for images and the relative path. The paths are specified in a map with the syntax =Map{Pair{"src","<source folder>"},Pair{"dest","<destination folder>"}}.
Disciplines > ECAD > EPLAN Electric P8 > EPLAN Data Zip (.edz) generation > Parameter name for the part attributes Map Page Part attributes The part attributes are specified with the syntax =Map{Pair{"<Attribute name1>","<Value>"},Pair{"<Attribute name2>","<Value>"}}. At least one of these part attributes has to be specified:
  • P_ARTICLE_PARTTYPE
  • P_ARTICLE_GROUPSYMBOLMACRO
  • P_ARTICLE_PARTNR
  • P_ARTICLE_TYPENR
Disciplines > ECAD > EPLAN Electric P8 > EPLAN Data Zip (.edz) generation > Parameter name for macro path String Page Macro name Stores the relative path to the macro that is generated.

The following method generates an EDZ file from a schematic page that contains a macro already generated. If the schematic contains more than page, an error message is output. The name of the generated EDZ file is returned.

Argument Type Description
wiringDiagram WiringDiagam Project component of the WiringDiagram type whose subcomponents are collected.
targetFolderName String Name of the target directory, where the generated EDZ file is stored. The EDZ file is stored with the specified part number as the file name.
When a relative path is specified, the generated EDZ file is stored in the project directory.
Alternatively an absolute path can be specified.

The following method generates an EDZ file from a schematic page that contains a macro already generated. If the schematic contains more than page, an error message is output. The name of the generated EDZ file is returned.

Argument Type Description
root Root Project component, subcomponents of the WiringDiagram type thereof are collected.
targetFolderName String Name of the target directory, where the generated EDZ file is stored. The EDZ file is stored with the specified part number as the file name.
When a relative path is specified, the generated EDZ file is stored in the project directory.
Alternatively an absolute path can be specified.

Placeholder object with variables for the generation of an EDZ+ file:

Property Current value Variable
Macro box > <Macro name> > Macro:Name > Macro:Name[1] <Name of the macro box> <Macro name>
Free text > <MacroVariant> > Text contents <MacroVariant> <MacroVariant>
Free text > <MacroRepresentationType> > Text contents <MacroRepresentationType> <MacroRepresentationType>
Free text > <MacroInsertPointActive> > Text contents <MacroInsertPoint> <MacroInsertPoint>

See also: