EPLAN Macros
On this page
EPLAN macros are part of the EPLAN integration in the Pro+ and Enterprise plans. Studio lists the macros of your macro folder, shows them before you insert them and places them on the pages of the open EPLAN project, without switching to EPLAN.
Prerequisites
- An open EPLAN project in Studio (see EPLAN Integration).
- A Pro+ or Enterprise license.
- The EPLAN option for importing and inserting macros for every insert, for filling placeholders and for macro projects. Without it, these commands are greyed out; browsing and previewing macros still works.
The Macros View
Open the Macros view in the EPLAN sidebar. It lists the macro folder of EPLAN by sub folder: window macros, symbol macros and page macros, each with its kind.
- Type in the filter box to find macros by name or folder.
- Show More at the end of the list loads further macros.
- Select a macro to see its description, its variants and its placeholders below the list.
- Change Macro Folder… in the title bar lists another folder, for example the macros of your company. Use EPLAN Macro Folder returns to the macro folder of EPLAN. You can also set the folder in Settings > EPLAN > Macro Folder.
- Right-click a macro for Show Preview, Insert into Page…, Insert Pages… and Reveal in File Explorer.
Preview a Macro
Double-click a macro or choose Show Preview. The preview opens in its own editor with zoom and pan. For a window or symbol macro, the Variant picker shows each representation type and variant; for a page macro, the arrows step through its pages. Insert into Page… or Insert Pages… in the toolbar inserts the macro with the variant you see.
Insert a Window or Symbol Macro
- Right-click the macro and choose Insert into Page….
- Pick the page. The page open in the page preview comes first.
- Choose the position:
- Place in Preview opens the page and waits for your click at the position of the macro. Press Escape to cancel.
- Enter Coordinates asks for X and Y on the page in millimetres.
- Pick the variant when the macro has several, and how EPLAN names the devices: Number gives them new device tags, Keep the names of the macro keeps the tags stored in the macro.
- When the macro has placeholders, insert without values, apply one of its value sets or choose Enter Values… and type a value for each variable.
Studio reports how many objects it inserted; Show Page opens the page.
Insert Pages from a Page Macro
- Right-click a page macro and choose Insert Pages….
- Choose where the pages go: where the macro places them, or after a page of your project.
- Type the full name of the first new page, for example
=A1+B1/10, or leave it empty to keep the page names of the macro. - Choose how EPLAN names the devices, including Ignore.
- Choose Keep Existing Pages or Overwrite Existing Pages. Before Studio replaces pages, it asks you once more.
- Apply a value set or enter placeholder values.
Placeholders
Right-click a page or the Pages group in the Project Explorer:
- Show Placeholders lists the placeholders of the page with their value sets, variables and the value set applied last.
- Fill Placeholders… applies a value set or writes the values you enter. Studio writes the texts in the EPLAN text language; the other languages of a text stay as they are.
One Card Page per TIA Portal Module
In the hardware comparison of EPLAN and TIA Portal, Insert Card Pages from Macro creates one EPLAN page per TIA Portal module from a page macro:
- Select the modules (or leave the selection empty for all modules of the shown stations) and choose Insert Card Pages from Macro.
- Pick the page macro of one card page. Studio remembers it for the next time.
- Type the full name of the first card page, for example
=A1+B1/10. The next modules get the next free page numbers. - For each placeholder variable, pick the TIA Portal value it gets: module name, station, article number, firmware, slot, I/O addresses, IP address or device name, a fixed text, or leave it empty.
- Studio lists the pages and the modules it skips (for example a module without an article number). Choose Insert Pages.
All pages arrive in one step. TIA Portal is only read.
Macro Projects
When a macro project is open, Macros in the title bar of the Project Explorer offers:
- Prepare Macro Project… groups the macro boxes and, if you like, the contents of the page macros and sets handles.
- Generate Macros… writes the macros of the project as macro files into two folders you choose, one for window macros and one for page macros. Studio never writes into the macro folder of EPLAN; copy the new macros into your library yourself.
Undo
Inserted macros, filled placeholders and a prepared macro project made by the AI assistant are undone with Discard AI Changes.
With the AI Assistant
You can ask the EPLAN Engineer agent to list your macros, read the variants and placeholders of a macro, insert a macro at a position, insert one card page per TIA Portal module or fill placeholders. It asks for your confirmation before every change and can show you the page as an image afterwards.
Availability
EPLAN macros come with the Pro+ and Enterprise plans, the same access level as the other EPLAN features.