.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.

Properties

PRT PartsASM AssembliesDRW 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

FieldPurpose
OutputFolderFolder for the CSV. Blank writes it beside each document, which for a batch spread across folders means several CSVs — rarely what you want.
CsvNameThe one file every document appends to. Defaults to properties.csv.
ScopeFile, Active configuration, All configurations, or File and all configurations.
IncludeEmptyOn by default. Clear it to leave out properties whose value is blank.

The format

One row per property — "long" format:

ColumnHolds
FilePathFull path of the document
FileNameJust the file name, for matching after files move
ConfigurationEmpty for a file-level property, otherwise the configuration name
PropertyNameThe property
TypeText, Number, Double, YesOrNo, Date, Equation
ValueThe stored value, so D1@Sketch1 stays an expression
ResolvedValueWhat 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.