.swp macro

Find and Replace in Properties: bulk edit values

Replaces text inside custom property values across many files. Works on parts, assemblies and drawings.

Properties

PRT PartsASM AssembliesDRW Drawings

Download Find and Replace in Properties.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 searches each document in turn.

To change a property's name rather than its value, use Rename Custom Property.

> Like the CSV importer, this can touch every property of every file in one run, so it defaults to > Preview and writes nothing until you switch it to Apply.

Inputs

FieldPurpose
FindThe text to look for inside values. Required.
ReplaceWithWhat to put in its place. Blank deletes the found text.
OnlyPropertyLimit to one property by name. Blank searches every property in scope.
ScopeFile, Active configuration, All configurations, or File and all configurations (the default).
MatchCaseOff by default.
ModePreview (report only) by default, or Apply changes.

Run Preview first

Preview does everything except write, and reports each change as old -> new:

Preview - would change 2. Vendor: OLD-CORP -> NEW-CORP. [Long] Vendor: OLD-CORP LTD -> NEW-CORP LTD.

Every previewed file comes back as a Warning, not an OK, so a 300-file preview cannot be mistaken for a completed run. Export the results panel to CSV if you want the whole list to review, then switch Mode to Apply changes and run the same job again.

What it does not touch

The stored value is what gets searched, not the resolved one. A property holding D1@Sketch1 resolves to a number; searching and rewriting the resolved value would replace the expression with the number it currently evaluates to and break the link permanently.

The property keeps its type. A Date or Number property stays one.

Properties whose value does not contain Find are left completely alone — not rewritten with an identical value — so a re-run over an already-converted folder saves nothing and dirties nothing.

Results

OutcomeMeaning
OKApplied and saved. Names the first few changes and counts the rest.
WarningPreview, or no value in scope contained the search text.
ErrorRead-only, never saved, or the save failed.

Read-only is checked before anything is written, because SOLIDWORKS accepts changes into the in-memory document and only refuses at save time — a late check would report a clean run for a file that never changed on disk. In Preview the check is skipped, so you can preview a read-only folder.

Chaining

Place it before any export macro so the exported files carry the corrected values. In Apply mode it saves the document; in Preview it does nothing at all.