SolidWorks-CLI

Open, create, save and sandbox SOLIDWORKS files from the command line

Every CAD workflow starts with document control. These verbs attach to a live SOLIDWORKS session via the Running Object Table, open or create parts and assemblies, make safe sandbox or Pack and Go copies, check rebuild health, and save or close cleanly without touching production originals by accident.

13 of the 92 verbs · Windows x64 · Late-bound SOLIDWORKS COM API

solid info [--file FILE] [--expect FILE] [--brief] [--pid N]
Revision, the list of open documents (the open-document list: path, title, kind, saved) and the active document of one session
solid open --file FILE [--rebuild] [--reload] [--pid N] [--confirm]
Makes FILE the active document
solid activate --file FILE|NAME [--pid N]
Makes an already-open document active (a path, or a file name or title of an open one), quietly: ActivateDoc3 without a rebuild
solid close --file PATH|TITLE [--index N] [--all-unsaved] [--with-open] [--pid N] [--discard] [--confirm]
Closes one open document, never saving
solid save [--as FILE] [--file FILE (open, writable)] [--expect FILE] [--pid N] [--confirm]
The only verb that saves: the active document in place, or with --as a COPY under FILE
solid rebuild [--file FILE] [--force] [--pid N] [--confirm]
Rebuilds the active document, or the open document FILE without activating it, whatever its kind (part, assembly, drawing): EditRebuild3, or ForceRebuild3 with --force
solid check [--file FILE] [--expect FILE] [--pid N] [--digest] [--rebuild] [--confirm]
Rebuild errors and warnings of the active part: features with a non-zero code and its text, featureCount, ok
solid new-part --out FILE [--template FILE] [--pid N] [--confirm]
Creates a new part from --template or the installation's default part template
solid new-assembly --out FILE [--template FILE] [--pid N] [--confirm]
Creates an empty assembly from --template or the installation's default assembly template
solid sandbox --file FILE [--new] [--pid N]
Copies FILE to
solid pack-and-go --out DIR [--file FILE] [--expect FILE] [--imports SUB] [--suffix S] [--detail] [--open] [--pid N] [--confirm]
Pack and Go of the active document (--file activates it first: on a non-active assembly SOLIDWORKS lists only part of the references) with every reference (suppressed and toolbox included, drawings not) into DIR, references rewritten by…
solid scratch-part [--out FILE] [--size X,Y,Z] [--pid N] [--confirm]
A throwaway part with one unconsumed sketch in one call: new-part --out FILE
solid scratch-asm [--parts N] [--part FILE] [--out FILE] [--open-part] [--pid N] [--confirm]
A throwaway assembly in one call: new-assembly --out FILE

Common questions

How does SolidWorks-CLI attach to a running SOLIDWORKS session?

Through the Windows Running Object Table (ROT), never CreateObject. solid sessions lists every live session PID, solid info reads the open and active documents, and --pid targets a specific session when multiple windows are open.

How do I test edits safely without modifying production CAD files?

solid sandbox copies a part into workspace/scratch/ and opens the copy, while solid pack-and-go creates a self-contained assembly copy with rewritten references. Write verbs refuse --apply outside workspace/ unless --confirm is explicitly passed.

Run these verbs on your own SOLIDWORKS models

Every verb above returns structured JSON and takes plain command-line flags. SolidWorks-CLI is local and on-premise: zero UAC elevation, zero SOLIDWORKS interop DLLs redistributed, and every write is a dry run until you pass --apply. Fourteen-day free trial with corporate e-mail, no card.

Start a 14-day free trial

Other verb families