Learn the basics of AutoCAD and More!

Lesson 4-04 – Command Aliases and Macros

πŸ” Lesson 4-4: Command Aliases and Macros

Automate repetitive tasks and increase drafting speed using aliases and custom macros.


πŸ“š What You’ll Learn

In this lesson, you’ll explore how to speed up your workflow by:

  • Using and customizing command aliases (keyboard shortcuts)
  • Creating macros to perform multiple actions with one click
  • Applying macros to buttons, palettes, and ribbons
  • Managing and sharing your customizations

🧠 Why It Matters

Custom aliases and macros help reduce keystrokes, save time, and remove repetitive stepsβ€”perfect for anyone working in a production-heavy environment or looking to streamline their drafting process.


πŸ› οΈ Tools You’ll Use

Tool / FeatureDescription
ALIASEDIT or acad.pgpEdit or create keyboard shortcuts for AutoCAD commands
CUI (Customize User Interface)Interface for assigning macros to toolbars, ribbons, and menus
MacrosCommand strings that automate multi-step tasks
Command line scriptingThe syntax used to build a macro

🧭 Lesson Structure

1️⃣ Understand Command Aliases

  • Open ALIASEDIT or manually edit acad.pgp file
  • Example: Set L for LINE, C for COPY
  • Reload aliases with REINIT or restart AutoCAD

Tip: Keep frequently used commands under two keystrokes!

2️⃣ Create Custom Aliases

  • Add new alias: TP, *TOOLPALETTES
  • Avoid duplicate entries to prevent conflicts
  • Test changes by typing aliases on the command line

3️⃣ Learn Macro Basics

  • Syntax: series of command-line entries
  • Use semicolons ; to represent [Enter]
  • Example: ^C^Czoom;extents;regen; β€” zooms to extents and regens view

4️⃣ Apply Macros to Interface

  • Open the CUI Editor
  • Add macros to:
    • Ribbon Buttons
    • Tool Palettes
    • Right-click Menus
  • Add tooltips and icons to clearly label functions

5️⃣ Organize and Share Custom Settings

  • Save customized CUI as .cuix
  • Back up your modified acad.pgp and share across users
  • Document macros with clear naming conventions

βœ… Lesson Checklist

TaskCompleted
Viewed and edited existing aliases☐
Created a new custom alias☐
Built a macro with multiple commands☐
Added a macro to the ribbon or palette☐
Backed up and exported customization files☐

πŸ“Œ Quick Tips

TipBenefit
Use ^C^C to cancel any running command firstEnsures macros work consistently
Use REINIT after editing the .pgp fileReloads aliases without restarting AutoCAD
Test macros in small stepsEasier to troubleshoot errors
Store macros in a shared CUI fileStandardizes team workflows

🧩 Real-World Applications

  • Drafting Teams: Shorten commands to single keys for speed
  • Construction Documents: One-click macros for sheet setup
  • Visualization: Macros to prep 3D views or render settings
  • QA Checklists: Automate layer cleanup, zooms, or settings

πŸ“ Files and Resources

ResourceDescription
acad.pgp fileAlias definition file (can be edited manually or with ALIASEDIT)
.cuix fileCustom User Interface file to store ribbon/macros
Macro SnippetsSample macros for zoom, layer control, viewport setup
AutoCAD DocsOfficial guide on macro syntax and scripting

🧠 Review Table

FeaturePurposeExample Syntax
Command AliasShortcuts for full commandsC, *COPY
MacroExecutes multiple steps^C^C-layer;on;0;;
Ribbon ButtonPlace to trigger a macro visuallyAdded via CUI editor
Tool PaletteApply macros via block-like iconsDrag-and-drop macro setup