Skip to content

About

One-keystroke, date-stamped incremental save for Vectorworks. A single Python file you paste into the Plug-in Manager.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Incremental Save for Vectorworks

A one-keystroke "save as" for Vectorworks that stamps the file name with today's date and a running sequence number, so a day's work leaves a readable trail of versions instead of a pile of final_v2_really_final.vwx.

No dialog, no typing, no install script — paste one file into the Plug-in Manager and assign a shortcut.

日本語の README はこちら

What it does

With today being 2026-09-09 (260909):

Current file After the command
MyDrawing.vwx 260909MyDrawing_001.vwx
260909MyDrawing.vwx 260909MyDrawing_001.vwx
260909MyDrawing_001.vwx 260909MyDrawing_002.vwx

And when you come back on 2026-09-13 (260913):

Current file After the command
260909MyDrawing_002.vwx 260913MyDrawing_001.vwx

The rules:

  • No date prefix — prepend today's date, start the sequence at _001
  • Date prefix is not today's — replace it with today's date, reset to _001
  • Date prefix is today's — increment the trailing sequence (_001 if there is none)

The folder and the file extension never change. The document you are working in follows the save, so the next press continues from the new name.

Requirements

  • Vectorworks with Python scripting (Vectorworks 2018 and later ship Python)
  • No third-party packages — Python's standard library only

Verified end to end on Vectorworks 2024 (build 787494, Python 3.9.2) on Windows: repeated saves, the date rollover, a file with no date prefix, and Japanese file names were all driven against a live document. Other Vectorworks versions and macOS are expected to work — the three functions used are long-standing — but have not been tested. Reports welcome.

Install

  1. Download incremental_save.py and open it in a text editor.
  2. In Vectorworks, open the Plug-in Manager: Tools ▸ Plug-ins ▸ Plug-in Manager. The exact wording of the tab and buttons shifts slightly between versions.
  3. On the custom plug-ins tab, click New…, name the command Incremental Save, and choose Command as the type.
  4. Select it, click Edit Definition ▸ Edit Script, set the script language to Python, and paste the entire contents of incremental_save.py.
  5. Close the Plug-in Manager.
  6. Open the Workspace Editor (Tools ▸ Workspaces) and drag Incremental Save — it appears under the Miscellaneous category — onto the File menu, or wherever you want it.
  7. Still in the Workspace Editor, switch to the keys/shortcuts tab and assign a shortcut such as Ctrl+Alt+S.

That is the whole installation. Nothing is written outside Vectorworks' own plug-in storage, and there is no path to configure.

Installing as a module instead

If you would rather edit the script in a real editor than in the Plug-in Manager, drop incremental_save.py into a plug-in folder and paste this loader into the menu command instead of the whole file:

import os, sys, importlib, vs
ok, found = vs.FindFileInPluginFolder('incremental_save.py')
if ok:
    # Vectorworks 2024 returns the containing folder, not the file itself.
    folder = found if os.path.isdir(found) else os.path.dirname(found)
    if folder not in sys.path:
        sys.path.insert(0, folder)
    import incremental_save
    importlib.reload(incremental_save)
    incremental_save.run()
else:
    vs.AlrtDialog('incremental_save.py was not found in any plug-in folder.')

The module does nothing on import — run() is the entry point — and importlib.reload means edits take effect without restarting Vectorworks. Both routes are tested against a live Vectorworks 2024: importing the module never touches the document, and pasting the file into the Plug-in Manager runs it.

Settings

Edit the constants near the top of the file.

Constant Default Meaning
LANG 'auto' Dialog language: 'en', 'ja', or 'auto' to follow Vectorworks' own language
SKIP_EXISTING True If the computed name is already taken, keep incrementing instead of overwriting
SHOW_RESULT True Show a dialog reporting the old and new name. Warnings and errors appear either way
SEQ_DIGITS 3 Minimum width of the sequence number
DATE_FORMAT '%y%m%d' Date prefix format — see below
MAX_COLLISION_TRIES 999 How far SKIP_EXISTING will search before giving up

SKIP_EXISTING is the safety net. With it on, an existing file is never overwritten: if every name up to MAX_COLLISION_TRIES is taken the command stops and says so rather than picking one. With it off, the computed name is used verbatim and a file of that name is replaced.

DATE_FORMAT must render to the same width on every date, because that width is how the prefix is recognised on the next run. '%y%m%d' → 260909, '%Y%m%d' → 20260909, '%y%m%d_' → 260909_ are all fine; variable-width codes such as %-m are not.

Behaviour worth knowing

  • The document moves. SaveActiveDocument renames the open document rather than writing a detached copy — verified on Vectorworks 2024, where GetFPathName() returns the new path afterwards and the return value is 0. If a version ever behaves otherwise the command detects it and warns, because a copy would mean the next run computing the very same name again.
  • Unsaved documents are refused. A document that has never been written to disk has no folder to save into, so the command asks you to save once first.
  • The date prefix must be a real date. 20260909plan.vwx is not recognised under the default '%y%m%d', because 202609 would be month 26. It is treated as an ordinary name and becomes 26090920260909plan_001.vwx. Set DATE_FORMAT = '%Y%m%d' if you keep eight-digit prefixes.
  • A file named only after a number keeps its name. Six-digit job codes are common, and many of them parse as a date. A date prefix is only recognised when something follows it, so 240115.vwx becomes 260909240115_001.vwx rather than losing the number.
  • Sequences grow. _999 is followed by _1000 rather than wrapping.
  • Underscores in your own names are safe. Only a trailing _ plus digits is read as a sequence, so plan_A.vwx becomes 260909plan_A_001.vwx.
  • There is no separator between the date and the name by default (260909MyDrawing); add one with DATE_FORMAT if you prefer.
  • Each save adds about ten characters to the name. On Windows, a deep project folder plus a long name can eventually meet the 260-character path limit.

Tests

The naming logic is plain Python and runs without Vectorworks:

python test_naming.py

33 tests cover the specification, sequence carrying, year boundaries, date detection, non-ASCII names, alternative date formats, collision avoidance against real files in a temporary directory, path comparison across Unicode normalisation forms, and — with a stand-in vs module — that importing the file never saves anything while pasting it into the Plug-in Manager does.

CI runs the suite on Linux, Windows and macOS, against Python 3.9 (what Vectorworks 2024 embeds) and 3.13.

How it works

Three Vectorworks Script calls, plus GetCurrentLocalization to pick the dialog language:

Call Used for
GetFPathName() Full path of the active document
SaveActiveDocument(path) Save without presenting a dialog
AlrtDialog(text) Report the result

Everything else — parsing the name, deciding the next one, avoiding collisions — is ordinary Python, which is why it can be tested outside the application.

License

MIT — see LICENSE.

About

One-keystroke, date-stamped incremental save for Vectorworks. A single Python file you paste into the Plug-in Manager.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages