.swp macro
Rename Custom Property: rename across many files
Renames a custom property across many files. Works on parts, assemblies and drawings.
Download Rename Custom Property.swp Get SwMacroFlow
Put the downloaded file in this folder, then open SwMacroFlow and choose it from the library.
%LOCALAPPDATA%\SwMacroFlow\macros
Runs per file — point the scope at a folder and it renames the property in each document in turn.
Inputs
| Field | Purpose |
|---|---|
| OldName | The property to rename. Files that do not have it are reported as nothing to do, not as failures. |
| NewName | The name to give it. |
| Scope | File, Active configuration, All configurations, or File and all configurations (the default). |
| Overwrite | Off by default. Leave it off and a document that already has NewName is reported rather than quietly overwritten. |
SOLIDWORKS has no rename
There is no rename API for a custom property, so this adds the new name carrying the old value and then deletes the old one. Two consequences:
- The property moves to the end of the list. It is genuinely a new property. Nothing reads custom properties by position, but it will look different in the Summary Information dialog.
- The stored value is carried, never the resolved one. A property holding
D1@Sketch1keeps that expression. Carrying the resolved value would write the number it currently evaluates to and break the link permanently — the rename would quietly become a flatten.
The type is carried too. A property that was a Date or a Number keeps behaving like one in a BOM or a drawing note, rather than everything becoming Text.
Results
| Outcome | Meaning |
|---|---|
| OK | Renamed and saved. Says how many stores changed. |
| Warning | The document does not have OldName anywhere in scope. Nothing was saved. |
| Error | Read-only, never saved, NewName already present with Overwrite off, or the save failed. |
Linked properties
If the old property is linked to a dimension or an equation, SOLIDWORKS refuses to delete it. The new name will have been created in memory, but nothing is saved and the file is reported as an error naming the property — rather than being left with both names on disk.
Chaining
Place it before any export macro so the exported files carry the renamed property. It saves the document, and does not close or rebuild it.
Add the macro several times in one chain to rename several properties in a single pass over the files.