At the macro boxes various functionalities are available by means of which you can, for example, modify the composition of the prepared macros in a macro project or can subsequently update the inserted macros in a schematic project.
Requirements (editing in the macro project):
- You are in a macro project.
- You have inserted one or more objects in a project page, from which a macro is to be automatically generated, and you have defined the plan of the macro to be created, using a macro box.
Requirements (editing in the schematic project):
- During the preparation of the macro in the macro project at the macro box you specified that macro boxes are also to be inserted in the drop-down list Also insert macro box or by means of the commands File > Settings > Projects > "Project name" > Graphical editing > General.
- You are in a schematic project and have inserted a macro.
Create a new macro
Using a macro box that is inserted with a macro, you have the option of editing the objects associated to a macro and saving the macro anew. Possible changes for the macro objects would be, for example, a symbol exchange for a component, changed data in a properties dialog, or a new value set for a placeholder object.
- Make the desired changes to the macro objects.
- Click the associated macro box.
- Select the Create macro popup menu item.
EPLAN opens the Save as dialog. The file name and variant of the macro are predefined. - Click [OK] to confirm the overwrite.
- Confirm the prompt regarding overwriting the macro variant with [Yes].
Update macros
You can update single or multiple macros in a project by means of the Update macro functionality. This way you can update macros inserted in a project rapidly following a revision.
Precondition:
You have selected one or several prepared or inserted macros with the Type of usage "Referencing" or "Not specified". In the associated macro box the type of usage is specified by means of a drop-down list of the same name.
Note:
If the "Subordinate" type of usage is used at nested macro boxes for the macro boxes lying on the inside, these macro boxes are not taken into consideration during project-wide updating or updating of the outer macro boxes. If a subordinate macro box is selected specifically, "manual" updating is nevertheless possible. In this case you can decide after a query whether updating is to be carried out or not.
Update individual macros via a macro box
- Click the desired macro box.
- Select the Update macro popup menu item.
- In the Settings field of the Update macros dialog, select an appropriate scheme from the drop-down list. Or click [...] to open the Settings: Update macros dialog. You can view the settings here for the selected scheme, and also create and edit your own schemes.
- Click [OK].
The related macro file belonging to the selected macro box is searched in the specified macro directory. If the selected macro exists in this directory, then the appropriate variant and representation type is determined within the macro file and the macro is updated with the relevant macro box in accordance with the specified settings.
If errors occur during the update, they are logged in the system messages.
Update multiple macros via the macro navigator
- Select the following commands: Tab Insert > Command group Macros > Navigator.
- In the tree of the macro navigator mark a project or multiple macros.
- Select the Update macros popup menu item.
- In the Settings field of the Update macros dialog, select an appropriate scheme from the drop-down list. Or click [...] to open the Settings: Update macros dialog. You can view the settings here for the selected scheme, and also create and edit your own schemes.
- Click [OK].
The related macro files belonging to the selected macros are searched for in the specified macro directory. If the selected macros exist in this directory, the suitable variants and representation types are determined within the macro files and the macros updated according to the settings specified.
If errors occur during the update, they are logged in the system messages.
Note:
When updating from a revised macro, modified data of the Macro box tab is also transferred to the project. Aside from the properties like Name, Representation type, and Variant, the values of the following read-only properties are also transferred:
- Version
- Source project
- Source / reference
- Description
- Manual object assignment
- Ignore macro box when inserting on mounting panel.
Select macro objects
If you would like to check which objects belong to a macro (are assigned to a macro box), there is a function that enables you to do this.
- Click the desired macro box.
- Select the Select associated objects popup menu item.
All objects belonging to the macro are selected.
You can then copy, move, or edit all of the macro objects in a table, for example.
Assign individual objects to a macro box
Normally, all objects located in a macro box belong to one macro. In a macro project you have the option of changing this macro object assignment.
- Select the objects that should belong to the macro. When doing this, you can also select objects that are not within the macro box, or exclude objects that are.
- Click the desired macro box and select the Assign objects to macro box popup menu item.
The objects are assigned to the macro. You can check the assignment by selecting the Select associated objects popup menu item for the respective macro box.
By making this assignment the Manual object assignment check box will be selected in the Macro box tab in the properties dialog. If you wish to remove the manual object assignment, then you must deselect the appropriate check box or select the Discard manual assignment popup menu item at the macro box. The associated objects in the macro box will then be back in the future macro. Simultaneous rescinding of the manual object assignment is possible through the multiple selection of macro boxes.
Moving a handle
The handle is defined as the point where the cursor "sticks" when the macro is inserted. Normally, the macro hangs at the "top, left" on the first insertion point. Use the macro box to define the position of the handle.
- Click the desired macro box.
- Select the Move handle popup menu item.
- Move the cursor to the desired position and, with a mouse click on the project page, define the position where the handle of the macro is to be located.
When generating macros automatically from the macro project, the handle is also stored in the macro with the macro box.
See also