Delcam PowerMILL Macro Language
A domain-specific scripting and macro language embedded in Delcam PowerMILL (now Autodesk PowerMill), used to automate CNC toolpath programming, parameterize machining strategies, and extend CAM workflows.
Created by Delcam plc (now Autodesk, Inc.)
The Delcam PowerMILL Macro Language is a domain-specific scripting language embedded in PowerMILL (now branded Autodesk PowerMill), one of the longest-standing commercial 3D CAM systems for programming 2- to 5-axis CNC milling machines. The macro language provides CAM programmers and tooling engineers a way to automate repetitive toolpath programming, parameterize machining templates, encode shop-specific standards, and integrate PowerMill with external workflow systems — without leaving the CAM application. For roughly three decades, the PowerMill macro language has served as the primary accessible customization layer for PowerMill users, enabling everyone from individual programmers to large aerospace and automotive tool shops to build their own automation on top of the platform.
History & Origins
DUCT, Delcam, and the Power Solution
PowerMill’s lineage traces back to DUCT, a pioneering CAD/CAM system originally developed in 1973 at the University of Cambridge by Donald Welbourn and Ed Lambourne, with industrial collaboration and funding from the Delta Metal Group. DUCT was one of the earliest commercial systems to treat complex sculpted surfaces as a first-class modeling and manufacturing target, a capability especially relevant for tooling in the automotive, aerospace, and consumer-products industries.
A 1989 management buyout led by then-managing director Hugh Humphreys and technical director Ed Lambourne separated the software activity from the Delta Metal Group, creating an independent software company that was reportedly renamed Delcam International in the early 1990s. Through the early 1990s, Delcam re-architected its tools to take advantage of the increasing power of Windows workstations, leading to the Power Solution range — a family of products covering conceptual design through manufacture. PowerMILL, first released around 1995, was the CAM component of that family.
The Macro Language as a First-Class Feature
From its earliest Power Solution releases, PowerMILL included a built-in macro language as part of the application, not as a third-party extension. The decision to embed a scripting layer directly in the CAM product reflected the realities of commercial CAM work: programming a complex mold or die is an inherently repetitive, rule-driven task, and shops that standardized on PowerMILL quickly needed a way to encode their standards so that different programmers produced consistent, reviewable results.
The macro language evolved in lockstep with PowerMILL itself. New PowerMILL features — new machining strategies, new tool types, new file format support — typically gained corresponding macro commands so that those features could be scripted as well as used interactively. The macro interface is, in effect, a scripting view of the same commands a user would issue from the PowerMILL user interface.
From Delcam PowerMILL to Autodesk PowerMill
In February 2014, Autodesk completed its acquisition of Delcam, in a deal that was, at the time, reported to be one of the largest in the CAM industry. PowerMILL, along with PowerShape, PowerInspect, FeatureCAM, and ArtCAM, became part of Autodesk’s manufacturing portfolio. For several years, Delcam operated as a wholly owned subsidiary, and the software retained the Delcam branding.
Over subsequent releases, Autodesk rebranded the products under its own name, with PowerMill (now styled with lowercase “ill”) continuing as a standalone product while also being integrated more tightly with Fusion 360 in the years that followed. Through all of this corporate evolution, the macro language and its .mac file format have reportedly remained backward compatible: macros written for older Delcam PowerMILL releases generally continue to execute in current Autodesk PowerMill versions, preserving the investment that large shops have made in their macro libraries.
Design Philosophy
A Command-Oriented Scripting Layer
The PowerMill macro language is best understood as a command-oriented scripting layer rather than a general-purpose programming language. Its basic unit of work is a PowerMill command — the same commands that a user can issue through menus, ribbons, or the command window. Macros are, at their simplest, sequences of those commands that can be recorded, saved, and replayed.
Around that command vocabulary, the macro language adds the programming constructs needed to make those command sequences useful in non-trivial cases: typed variables, conditionals, loops, function definitions, and access to PowerMill’s parameter model. This hybrid design makes simple macros extremely accessible — they can be generated by recording — while still providing enough programming structure to encode sophisticated automation.
Typed Variables
Unlike many scripting languages used as customization layers (AutoLISP, VBA, Tcl), the PowerMill macro language is explicitly typed. The documented primitive types are:
- INT — integer numbers (e.g.,
1,21,5008) - REAL — floating-point numbers (e.g.,
201,-70.5,66.0) - STRING — character sequences (e.g.,
"hello") - BOOL — truth values,
0(false) or1(true)
Variable names must begin with an alphabetic character and may contain alphanumerics and underscores. A distinctive feature of the language is that when a variable is being assigned or dereferenced, its name is prefixed with $ — a syntactic marker that lets the PowerMill command parser unambiguously distinguish variable references from command arguments and from PowerMill parameter names.
Integration with PowerMill Parameters
A major part of the macro language’s value is direct access to PowerMill’s parameter model — the extensive hierarchy of settings, entity properties, and computed values that define a PowerMill project. Macros can read and write these parameters, iterate over collections of entities (toolpaths, tools, boundaries, patterns, levels), and make decisions based on the current state of the project.
This integration is what makes the macro language genuinely powerful for CAM work. A macro is not only issuing commands in sequence; it can inspect the current project, make decisions about which strategy to apply, adjust parameters dynamically, and produce output tailored to the geometry and tooling at hand.
Key Features
Variables and Assignment
Variables are declared with an explicit type keyword, and assignments prefix the variable name with $:
INT Count
REAL FeedRate
STRING PartName
BOOL IsRoughing
$Count = 10
$FeedRate = 1500.0
$PartName = "impeller-blade-7"
$IsRoughing = 1
The $ prefix is documented as necessary for the PowerMill language parser to recognize an assignment rather than a command.
Conditionals
Macros support IF, IF..ELSE, and IF..ELSEIF constructs for decision making. Conditions compare variables and parameters using standard relational operators:
IF $Count > 0 {
PRINT "There is work to do."
} ELSE {
PRINT "Nothing to process."
}
A SWITCH statement provides multi-way branching where multiple equality comparisons against the same value would otherwise be awkward.
Looping
Three documented looping constructs are provided:
WHILE— executes the body while a condition holdsDO..WHILE— executes the body at least once, then checks the conditionFOREACH— iterates over a collection or list
A typical FOREACH form iterates over a literal list:
FOREACH Bottles IN {10,9,8,7,6,5,4,3,2,1} {
CALL PrintBottles(Count, Bottles)
}
FOREACH can also iterate over built-in PowerMill collections — for example, over all toolpaths in a project, all levels, or all entries in the macro_path search list:
FOREACH m_path IN $macro_path {
PRINT $m_path
}
Functions
The macro language supports user-defined functions, which package a named, reusable sequence of commands with parameters. Functions can be called with CALL and can accept typed arguments. Function definitions are often kept in include-style files (conventionally using the .inc extension) that other macros load.
Macro Recording and the .mac Format
PowerMill macros live in plain-text files with the .mac extension. Any text editor can edit them; third-party syntax-highlighting extensions exist for editors such as Visual Studio Code.
The primary entry point into macro authoring for most users is PowerMill’s built-in macro recording. Starting a recording captures the commands issued through the UI as the user works through an operation, producing a macro file that can be replayed to repeat the same sequence. Recording a working example and then editing the resulting .mac file to parameterize it is the canonical workflow for building up a macro library, and it reflects the language’s role as an automation layer rather than a greenfield programming environment.
Output, I/O, and Integration
The macro language provides commands for printing messages to the PowerMill command window (PRINT), displaying dialog messages, and reading and writing files — enough to integrate PowerMill automation with external data sources such as spreadsheet exports, shop-floor job files, and ERP-generated work orders.
Evolution
Continuity Over Decades
The most striking feature of the PowerMill macro language’s evolution is how little has changed at the surface. A shop that wrote macros against PowerMILL in the late 1990s or early 2000s generally finds those macros continue to run in modern Autodesk PowerMill releases with minimal adjustment. This continuity has been a deliberate commercial choice: the macro libraries accumulated by large customers are substantial investments, and backward compatibility is a significant factor in CAM purchasing decisions.
What has changed is breadth. Each PowerMill release adds new commands corresponding to new features: new roughing and finishing strategies, new tool geometries, new multi-axis machining operations, new verification and simulation features. The macro language grows with the product, and macros written today have access to a far richer set of commands than those available in 1998 — but the core syntax and semantics remain the same.
Coexistence with Other Automation Interfaces
In parallel with the macro language, Autodesk provides an additional COM-based automation interface and the open-source PowerShapeAndPowerMillAPI project on GitHub, which exposes PowerMill and PowerShape to .NET languages such as C# and VB.NET. This API is aimed at developers writing standalone applications that drive PowerMill externally, and at integrators who need deeper access than the macro language provides.
For the majority of shop-floor automation, however — parameterized toolpath generation, application of shop standards, batch processing of part families — the macro language remains the lower-barrier and more commonly used option, because it requires no external development environment, no compilation step, and no deployment infrastructure beyond a text editor and the PowerMill installation itself.
Platform Support
The PowerMill macro language runs inside the PowerMill application, and its platform availability is that of PowerMill. Autodesk’s published documentation has historically listed PowerMill as a Windows product for x64 systems; macros are therefore available wherever PowerMill runs. There is no known standalone interpreter for the macro language outside PowerMill, and no official Docker image for the language, because its execution environment is the PowerMill CAM application.
Community and Ecosystem
Practical Knowledge Sharing
Because the macro language is closely tied to a commercial CAM product with a specialized user base, the community around it is smaller and more focused than for general-purpose scripting languages. Key gathering points include:
- The Autodesk PowerMill forum (successor to the original Delcam user forum), where users exchange macros, ask syntax questions, and share solutions to production problems
- Long-running independent CAM and machining forums where PowerMill users post macros for common tasks
- The Autodesk PowerMill Macro Programming Guide, distributed by Autodesk as part of the product’s offline help and documentation bundle, which remains the authoritative reference for the language
Third-Party Tooling
External developers have built tooling to make macro authoring more comfortable outside the PowerMill application, including a community-maintained Visual Studio Code syntax highlighting extension for the .mac format. Some shops layer additional authoring conventions on top of the language, such as consistent include-file organization and shop-specific macro libraries that are version-controlled alongside NC programs.
Relationship to PowerShape and Other Delcam Macros
PowerShape, Delcam’s CAD companion to PowerMILL, has a related but separate macro language of similar design, and shops that use both products often maintain macro libraries that span them. According to community sources, a Custom Software Core (CSC) framework was historically offered within the Delcam ecosystem, providing a higher-level coding alternative for customers who found raw macro programming too low-level for their needs, though direct macro programming continues to be the more common approach.
Current Relevance
PowerMill remains a widely used CAM system, particularly in mold and die, aerospace, and high-end automotive manufacturing, and its macro language remains the everyday automation tool for its users. The language is neither growing quickly nor declining: it is a mature, domain-specific scripting layer that has found its niche and continues to serve it.
For new PowerMill customers, the macro language is often introduced through the recorder: new users learn the system interactively, record a macro of a common task, and gradually learn to edit the recording to parameterize it. For large production shops, the macro library can become a substantial internal asset — a repository of encoded know-how about how the shop prefers to machine specific part families, which tools are available on which machines, which post-processors to use, and how to document the result.
Autodesk’s ongoing documentation of the macro language, including the regularly updated Macro Programming Guide shipped with each release, signals that the language is treated as a supported, first-class customization interface rather than a legacy artifact.
Why It Matters
The Delcam PowerMILL Macro Language is a good example of a long-lived, narrowly scoped scripting language whose value comes not from innovative language design but from its tight coupling to a specific, demanding domain. CAM programming for complex 3D milling is a difficult, rule-heavy task with significant economic consequences — a badly programmed toolpath can break a part, a tool, or a machine — and the ability to encode a shop’s hard-won knowledge into a reusable macro library is genuinely valuable.
In the broader history of programming languages, the PowerMill macro language belongs to the family of application-embedded scripting languages — alongside AutoLISP in AutoCAD, VBA in Microsoft Office, and the various macro systems in competing CAM and CAD products — that together represent the largest population of practical “programmable software” in engineering and manufacturing. These languages are rarely taught in universities, rarely feature in language-of-the-year surveys, and yet they run some of the most economically important computations in modern industry. Decades after PowerMILL’s first Power Solution release, its macro language continues to do exactly that, on shop floors around the world.
Timeline
Notable Uses & Legacy
Aerospace and Automotive Tool and Die Manufacturing
Tool and die shops supplying aerospace and automotive OEMs use PowerMill macros to standardize the programming of complex molds, dies, and structural components, encoding shop-specific rules about tool selection, machining strategies, and stock handling so that different programmers produce consistent results.
High-Speed Machining of Molds and Dies
Mold makers use PowerMill macros to apply predefined machining templates across families of similar parts, automating the sequence of roughing, rest-roughing, and finishing strategies required for complex 3D cavity and core geometry.
5-Axis CNC Programming for Impellers and Blades
Manufacturers of turbine blades, impellers, and other complex 5-axis parts use PowerMill macros to programmatically apply specialized multi-axis strategies and to batch-generate toolpaths for part families where the machining intent is identical but the geometry varies.
Shop-Floor Automation and Post Processing
Production machine shops use PowerMill macros to enforce in-house standards: automatically naming toolpaths, selecting the correct NC post-processor, emitting setup sheets, exporting CL (cutter location) data, and integrating with ERP or shop-floor document control systems.
Dental and Medical Device Machining
Producers of dental prosthetics, orthopedic implants, and custom medical devices use PowerMill macros to automate the programming of highly repetitive part families, ensuring that each unit receives the same validated machining strategy required for regulated manufacturing.