Skip to main content

Hexagon Save Script

How It Works

When triggered, the script:

  1. Activates the target Hexagon Smart 3D window.
  2. Opens File > Exit using the keyboard shortcuts Alt+F, then X.
  3. Presses Alt+Y to select Yes when prompted to save the current work.
  4. Waits for the Save As dialog box to appear.
  5. Generates an autosave filename using the process ID and the current timestamp.
  6. Enters the generated filename in the Save As dialog box.
  7. Saves the file to the specified directory.
  8. Waits for the Save As dialog box to close.
  9. Allows Hexagon Smart 3D* to continue its normal exit process.

Generated File Name

Saved files use the following format:

autosave_<PID>_<YYYYMMDDTHHMMSS>
ComponentDescription
autosaveIndicates that the file was generated automatically.
PIDProcess ID (PID) of the Hexagon application.
YYYYMMDDTHHMMSSDate and time the project was saved.
Hexagon Autosave File

For example:

autosave_1234_20260629T142210

The date and time saved in this example is 2026-06-29 14:22:10.

Save Location

The script saves the file in the following order of precedence:

  1. The configured save folder, if specified.

  2. Otherwise, the Windows temporary directory:

    C:\Users\<username>\AppData\Local\Temp

Example Configuration

Example: Hexagon Save Script Custom Actions
BEGIN custom_actions
-------------------------------------------------------------------------------
title = Hexagon Save Script
command = %bin%AutoHotKey.exe
args ="%bin%ahk\Hexagon-save-script.ahk" %pid% "%root%Log\temp\Freeze\" | more
condition=exe=*smart3d.exe*
timeout = P5M
when-to-run = pre
---------------------------------------------------------------------------------