Macros — Aveva E3d

AVEVA E3D macros are powered by the Programmable Macro Language (PML)

, a domain-specific language used to automate complex modeling tasks and customize the user interface. Below is a look into the core features and advanced capabilities of macros in the E3D environment. AVEVA™ Documentation Core Macro Features Command Automation

: Users can store frequently used command sequences in text files (often with a extension) to execute them with a single click. Variable Management : PML supports both local variables global variables

), which can be assigned types such as REAL, STRING, BOOLEAN, or ARRAY. Arguments and Parameters

: Macros can be written in a generalized form using parameters for dimensions or part numbers, allowing users to input specific values only at runtime. Legacy Compatibility : The traditional

mechanism for invoking macros remains available, and most existing PML code from older versions (like PDMS) works unmodified. Advanced Customization Capabilities UI Form Design

: You can create custom graphical forms, gadgets, and menus using PML to overcome limitations of standard software interfaces. System Integration

: Macros can be used to export data to external formats, such as generating

(for Navisworks) or importing Excel files directly into E3D tables. Error Handling

: Advanced macros use error-handling blocks to manage cases where selected elements lack specific attributes, such as missing "P points" on a model. PML Rehash : A critical administrative feature where the PML rehash

command is used to scan libraries and register new macro files or forms in the system index. AVEVA Learning Academy Typical Use Cases Bulk Modeling

: Automating the creation of repetitive structures like tanks, holes, or gratings. aveva e3d macros

: Generating custom reports for missing components or verifying model weights. Workflow Optimization

: Using tools like "Quick Macro" to manage and sort frequently used scripts for daily design tasks.

Macros in AVEVA Everything3D (E3D) are powerful automation scripts designed to streamline design tasks, reduce repetitive work, and enhance project efficiency

. By utilizing PML (Programmable Macro Language), users can automate complex 3D modeling, modifications, and drawing production within the E3D environment. ASTS Global Core Features of AVEVA E3D Macros PML Automation (Programmable Macro Language):

Macros use PML to perform automated tasks, which can range from simple design changes to complex procedures that would take hours to do manually. Command Line Interaction:

Macros allow users to run commands directly from a text file, allowing for the automation of command-line sequences that are commonly used, such as show !!TDSmacassist to access macro assistance. Workflow Efficiency:

Macros reduce manual input, helping to minimize design errors and significantly increase productivity, particularly in high-precision, detailed 3D modeling projects. PML Rehash Command: PML REHASH

command is a key feature used to update the PML index, allowing the system to recognize new macro files instantly without restarting the application. Customizable User Directory:

Users can define and switch between different PML directories ( PDMS user directory ) to organize their macros effectively. How to Use E3D Macros (Simple Workflow) Create a Text File: Write the desired commands in a plain text file. Register Macros: Use the command PML REHASH

in the E3D command window to update the macro library and recognize the new file. Run Macros: show !!TDSmacassist

to open the Macro Assistant, then click on the required file from the list to execute the commands. Directory Selection: AVEVA E3D macros are powered by the Programmable

The macro assistant allows navigating to specific folders to choose macros, with an option to refresh the library. Benefits of E3D Macros Error Reduction: Automating repetitive tasks leads to fewer human errors. Increased Productivity:

Enables faster design turnaround for complex plant projects. Consistency:

Ensures that repetitive tasks (like structural modeling or piping placement) follow the same standard, as described in. ASTS Global


Title: Unlocking Productivity: A Deep Dive into AVEVA E3D Macros

Subtitle: Automate repetitive tasks, enforce design standards, and slash modeling time with custom command scripting.

Reading Time: 4 minutes


If you have spent any significant time in AVEVA E3D (formerly PDMS), you know the drill. You repeat the same sequence of commands: NEW CE, CONN HEAD, SPREF O:100, CREATE. Over and over again. It is accurate, but it is slow.

Enter E3D Macros – the oldest, yet most underutilized, productivity booster in the software.

A macro is simply a text file (.txt or .mac) containing a list of native E3D commands. When you run the macro, E3D executes each line sequentially as if you typed it yourself. But when done right, macros are not just about speed; they are about standardization and error reduction.

Part 3: Creating Your First Macro (Step-by-Step)

Let's build a practical macro that creates a vertical vessel shell.

The Power User Trick: Conditional Logic & Loops

Most users stop at simple command sequences. But E3D macros support full PML logic. This is where you save hours. Title: Unlocking Productivity: A Deep Dive into AVEVA

Scenario: You need to add 20 evenly spaced grating plates across a walkway.

-- macro: add_grating.plate
DEFINE I 1
WHILE #I LE 20 DO
    NEW PLATE
    SPREF "GRATING-30"
    POS E ((#I - 1) * 250) N 0 U 1200
    ORI E
    XSIZE 200
    ZSIZE 800
    CREATE
    SET I = #I + 1
ENDWHILE

One macro. Twenty plates. Perfectly spaced. Zero typos.

5. Writing a Custom Macro – Example

Goal: Create multiple identical equipment at different coordinates.

-- Create three pumps in a row
DO !i FROM 1 TO 3
  NEW EQUI
  NAME 'P-10' + STRING(!i)
  TYPE 'CENTRIFUGAL'
  POS (!i-1)*2000 0 0
ENDDO

4. Create a Master Macro Menu

Build a macro that presents a text menu:

PML TEXT '1. Create Vessel'
PML TEXT '2. Create Pipe Support'
PML TEXT '3. Run Clash Report'
DEFINE CHOICE PROMPT 'Enter choice: '
IF (CHOICE EQ 1) THEN $M create_vessel.mac ENDIF

Step 1: Open Notepad (or better, Notepad++).

Part 8: Real-World Case Study – Saving 200 Hours

Scenario: An EPC firm needed to model 450 identical pipe racks across a refinery. Each rack had 20 handrails, 15 grating panels, and 8 vertical supports.

Manual time per rack: 45 minutes. Total manual: 337.5 hours.

Solution: A senior designer wrote a parameterized macro (rack.mac) that accepted:

The macro contained logic to:

  1. Loop from start to end in 2m increments.
  2. Place a vertical support at each increment.
  3. Run a secondary macro to auto-populate grating.
  4. Generate handrails along the X-axis using COPY with offset.

Result:


The Basics: The "Hello World" of E3D Macros

Let’s start simple. Open Notepad and create a file called create_column.mac.

-- Create a standard UC column at origin
NEW COLU
SPREF "UC-203X203X46"
POS E 0 N 0 U 0
XLEN 5000
CONN HEAD
CONN TAIL
CREATE
FINISH

How to run it: Place the file in your E3D project directory (or a folder defined in your PMLLIB path). In the E3D command line, type: MACRO create_column

Boom. A column appears. But that’s just the starting point.

10. Conclusion & Next Steps