.swp macro

Save STEP: export SOLIDWORKS parts to STEP

Exports the open part or assembly to a STEP file. Drawings are reported as unsupported.

Export

PRT PartsASM Assemblies

Download Save STEP.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 exports every part and assembly in turn.

Inputs

FieldPurpose
OutputFolderWhere the STEP goes. Blank saves it beside the document. Created if missing.
OutputNameFile name. Blank uses the document's own name. {Property} placeholders work here, so {PartNumber}_{Revision} is a valid pattern.
ProtocolAP203, AP214 or AP242. AP214 is the usual choice — it carries colour and is what most suppliers ask for.
OverwriteOn by default. Clear it to skip any document whose STEP file already exists, which is reported as a warning rather than an error.

File extension

.step is appended unless the name you give already ends in .step or .stp — so type {PartNumber}.stp if your downstream system wants the short form. The extension is never doubled.

Results

Reports the path it wrote and the protocol used.

On failure it decodes the SOLIDWORKS error rather than printing a number, so a run report distinguishes the cases that need different fixes:

Reported asCause
The target file is read-onlyThe existing STEP is read-only or checked in
The file is locked by another programSomething else has the STEP open
STEP export is not available in this SOLIDWORKS licenceTranslator not licensed
The full path is longer than Windows allowsLong folder plus long property-based name

Notes

The STEP protocol is a global SOLIDWORKS preference, not a per-export argument. This macro reads the current setting, changes it only if it differs from the one you chose, and puts it back on every exit path — including when an error is raised part-way through. Without that, running the macro once would quietly change the protocol for every STEP the user later exports by hand.

A document that has never been saved has no folder or name to derive from. Rather than writing to the drive root, the macro fails that file with a message asking for both OutputFolder and OutputName.

Chaining

Safe to place anywhere in a chain. It does not save, rebuild or close the document, so macros after it see the file exactly as they would have without it.