.swp macro
Export Properties to CSV: one spreadsheet per batch
Appends every custom property of each document to one CSV. A folder of 300 files produces one spreadsheet, not 300. Works on parts, assemblies and drawings.
Download Export Properties to CSV.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 — each file in the batch appends its own rows as it is opened.
Inputs
| Field | Purpose |
|---|---|
| OutputFolder | Folder for the CSV. Blank writes it beside each document, which for a batch spread across folders means several CSVs — rarely what you want. |
| CsvName | The one file every document appends to. Defaults to properties.csv. |
| Scope | File, Active configuration, All configurations, or File and all configurations. |
| IncludeEmpty | On by default. Clear it to leave out properties whose value is blank. |
The format
One row per property — "long" format:
| Column | Holds |
|---|---|
| FilePath | Full path of the document |
| FileName | Just the file name, for matching after files move |
| Configuration | Empty for a file-level property, otherwise the configuration name |
| PropertyName | The property |
| Type | Text, Number, Double, YesOrNo, Date, Equation |
| Value | The stored value, so D1@Sketch1 stays an expression |
| ResolvedValue | What that expression evaluates to |
Why long and not one column per property. The macro sees one document at a time and appends as it goes, so it cannot know the full set of property names in advance to build a header from. Long format also survives a folder where every document has a different property set, and it is what Import Properties from CSV reads back.
Encoding
Written as UTF-16LE, which Excel opens directly by double-click. This is not a detail: a property value can hold any character in the customer's documents, and the system codepage cannot represent all of them. An ANSI write turns those into question marks silently — a corrupted export that still reports success.
Results
Reports how many properties it appended and to which file. A document with no properties is a warning rather than an error, so it stands out in the run report without failing the batch.
Notes
Several SOLIDWORKS instances can share one batch queue, so two of them can reach the CSV at the same moment. The append is a single open-write-close and retries for a few seconds if the file is locked. If the CSV is open in Excel when the batch runs, the file is reported as locked rather than silently skipped — close it and re-run.
The header is written only by whichever file creates the CSV. Point a second batch at an existing CSV and it appends to it. Delete the file first if you want a clean export.
Chaining
Read-only with respect to the document — it does not write, save, rebuild or close anything. Safe anywhere in a chain, and useful as the last link to record what the earlier macros left behind.