Summary

This article explains how to install, configure, run, and maintain general-purpose GibbsCAM macros. A GibbsCAM macro is a runtime-interpreted plain-text program that can automate tasks such as creating geometry, defining tools and processes, and generating operations. It also explains how to use the official GibbsCAM Macro Wiki when selecting commands, examples, and version-compatible syntax.


Table of Contents


Before You Begin

  • Obtain macros only from a trusted source. A macro can create, modify, or delete data in the current GibbsCAM part.

  • Save a backup copy of the part and test every new or modified macro in a non-production file before using it on active work.

  • Identify every file the macro requires, including the main .mac file, optional .dlg dialog files, included macros, images, spreadsheets, or other external data.

  • Confirm the GibbsCAM release, part units, machine definition, coordinate system, workgroup, and required selections before running a macro.

  • If you plan to write or edit macro code, use a plain-text editor and be comfortable with variables, conditions, and loops.

Important: Example macros on the GibbsCAM Macro Wiki are provided for illustrative and instructional purposes. Review the files and test them safely before adapting them to production work.


Procedure

Step 1 - Select and Review the Macro

  1. Define the task that the macro must perform and the part data it is expected to read or change.

  2. Open the GibbsCAM Macro Wiki and locate the applicable topic by category, command name, or full-text search.

  3. Check the command's documented version and review the Removed or Replaced list when the macro was created for another GibbsCAM release.

  4. Review the macro source and its readme or example part. Identify required geometry, selected items, tools, processes, units, and external files.

  5. Keep an unchanged copy of the original macro package before editing or installing it.

Step 2 - Place the Macro Files

  1. Use GibbsCAM Pathfinder to locate the predetermined Macros folder for the active release.

  2. The standard location is typically C:\ProgramData\Gibbs\GibbsCAM\<version>\Macros\, although a different folder may be used.

  3. Create a clearly named subfolder for the macro package when it contains supporting files.

  4. Copy the .mac file and every required .dlg, included macro, image, spreadsheet, or data file into the expected locations without renaming referenced files.

  5. Confirm that the Windows account running GibbsCAM can read the files and write to any output folder used by the macro.

Step 3 - Add the Macro to the Macros Menu

  1. Start GibbsCAM and select Macros > Configure.

  2. Select an empty entry in the Macros dialog.

  3. Enter the name that should appear on the Macros menu.

  4. Browse to or enter the full path and filename of the main .mac file, then click Update.

  5. Use Move Up, Move Down, Move In, and Move Out to organize the entry. A name consisting of one hyphen creates a separator line.

  6. Click OK. The updated menu structure is applied immediately.

Step 4 - Run and Verify the Macro

  1. Open the test copy of the GibbsCAM part and satisfy the macro's documented prerequisites.

  2. Confirm the active units, machine, coordinate system, workgroup, selected geometry or operations, and any expected tool or process data.

  3. Select the configured macro from the Macros menu.

  4. Complete the macro prompts or custom dialog. Review all values before continuing.

  5. Inspect every geometry element, solid, tool, process, operation, file, or setting created or changed by the macro.

  6. Regenerate and simulate affected operations, review posted output when applicable, and save the part only after the results are verified.

Step 5 - Edit or Develop a Macro

  1. Open the .mac file in a plain-text editor and save it as plain ASCII text.

  2. Keep a simple macro in one .mac file, or separate reusable logic into additional macros called by the main file.

  3. Use a .dlg file when the macro needs a custom dialog with input fields, check boxes, radio buttons, dropdowns, buttons, or images.

  4. Use the Macro Wiki command pages for syntax and version information. Use its Examples section as a starting point for a similar workflow.

  5. Make and test one small change at a time in a disposable part file. Verify both valid inputs and expected error conditions.

Step 6 - Back Up and Maintain the Macro

  1. Back up the complete macro package and record its purpose, author, revision, required GibbsCAM version, and prerequisites.

  2. When upgrading GibbsCAM, use the Migration Tool to transfer compatible macro configuration files before manually rebuilding the menu.

  3. After migration, confirm the .mac file paths, supporting files, and command compatibility in the new release.

  4. If the current release was already configured before older macros were migrated, follow the migration guidance on the GibbsCAM Macro Wiki.

  5. For a support case involving part-dependent macro files, create a Pack and Go package when the required macro type is available for inclusion.


Expected Result

The macro appears in the GibbsCAM Macros menu, runs from the expected file location, and produces the documented result in a verified test part. Its supporting files and prerequisites are recorded, and the complete package is backed up for migration or troubleshooting.


Additional Information


Troubleshooting

  • Problem: The macro does not appear on the Macros menu.

Possible Causes

  • The macro has not been added through Macros > Configure.

  • The configured path points to the wrong GibbsCAM version folder or to a file that was moved or renamed.

  • The menu entry was not updated before the Macros dialog was closed.

Resolution

Open Macros > Configure, verify the display name and full path to the main .mac file, click Update, and then click OK. Reopen the menu and test the entry in a backup part.

  • Problem: The macro starts but reports a missing file or stops at a dialog.

Possible Causes

  • A required .dlg, included macro, image, spreadsheet, or data file is missing or was renamed.

  • The macro uses a relative path but its supporting files are not in the expected folder.

  • The Windows account does not have permission to read the source files or write the output location.

Resolution

Restore the complete macro package, preserve the original filenames and folder structure, and verify access to every referenced location. Run the macro again in a test part.

  • Problem: A macro that worked in an earlier GibbsCAM release now fails or gives different results.

Possible Causes

  • The menu configuration points to the older version's macro folder.

  • A command or parameter was introduced, removed, or replaced in another GibbsCAM version.

  • The new part uses different units, machine data, selections, or supporting files.

Resolution

Verify the configured file path and all macro prerequisites. Check the command's version on the Macro Wiki and review the Removed or Replaced list. Update a backup copy of the macro and validate it completely before production use.

  • Problem: The macro runs but creates incorrect geometry, tools, or operations.

Possible Causes

  • The active units, coordinate system, workgroup, machine definition, or selected items do not match the macro's assumptions.

  • Input values were entered incorrectly or the macro does not validate an unexpected value.

  • The macro was edited without retesting every dependent result.

Resolution

Close the part without saving if necessary. Reopen the backup copy, restore the documented prerequisites, verify every input, and run the macro again. Correct and retest the macro before using its output for machining.



Explore More from CAMCO

Visit the CAMCO website to learn more about:


Keywords

GibbsCAM Macros, Macro Menu, Configure Macros, .mac File, .dlg File, Macro Wiki, Macro Examples, Macro Commands, Runtime Interpreter, BASIC, Macro Migration, ProgramData, Automation