← All projects

swformat

Parse and manipulate the SolidWorks native file format without a SolidWorks install.

Python Apache-2.0
Commits
5
Stars
0
Created
June 12, 2026
View repo

Reverse-engineered toolkit for reading, inspecting, and modifying SOLIDWORKS .sldprt (part), .sldasm (assembly), and .slddrw (drawing) files. No SolidWorks license required. No SolidWorks installation required.

The native format is a proprietary compressed container (ZIP-like, with custom offsets and chunk management). swformat walks the internal structure, locates the CAD geometry, metadata, and design-tree information, and exposes them to Python for manipulation.

What it solves

Bulk metadata extraction. The SolidWorks COM API and Document Manager both parse every file through SolidWorks’ own engine—expensive per-file initialization overhead. swformat reads properties, configurations, sheet names, and model references directly from the file bytes, in-process, across thousands of files in parallel. Potentially faster. Definitely cheaper (no license, no installation).

Pipeline validation. A build server can scan a drawing corpus for broken references, missing configurations, and Toolbox defects without SolidWorks present. No license wall. No seat quota conflict. Works on Linux.

Metadata-only workflows. Training or fine-tuning a model to understand SOLIDWORKS drawing structure—sheet layouts, table content, note text, BOM structure—starts with mining a corpus. swformat does that read-heavy half cheaply. Geometry authoring still needs the live modeler (via COM).

Write scope

Deliberately narrow. Edit and delete existing custom properties, add new property names to the custom dictionary, rename configurations and drawing sheets, edit sketch geometry. All via span-preserving writes (edits recompress to fit the original space so offsets don’t shift).

Limitation: on assemblies and drawings, an edit that overflows the original compressed span raises SpanPreserveError. Parts can grow via relocate-to-EOF (moving the edit to the file’s end and updating the central directory), but assemblies and drawings are not yet there.

What it does NOT do

Cannot read geometry bounding boxes, body counts, or geometry-computed dimension values. Cannot author geometry, features, or design tree structure. Cannot replace the SolidWorks COM API for operations that touch the modeler. Cannot read pre-2015 OLE2 format or the 3DExperience ZIP/OPC format.

Small project (5 commits), sharp scope: reverse-engineer and document the format, enable metadata reads and targeted edits, don’t try to reimplement the CAD kernel. The format structure is documented in code and comments so future maintainers can understand it without derivation.

Where this stands

Better at

  • Read SolidWorks file metadata without any license or installation; scanning runs on build servers, archive drives, or unlicensed machines.
  • Potentially faster for bulk, parallel metadata reads than the SolidWorks COM API, which incurs per-file initialization overhead.
  • Safe by construction: read-only on original files by default, no running SolidWorks session to contend with, no crash or hang risk.
  • Span-preserving property edits on parts and assemblies are SW-verified to work; SolidWorks reopens the file and sees the changes.
  • Runs on Linux and CI environments where SolidWorks is not installed; pure Python, no binary dependencies.

Worse at

  • Cannot read geometry or geometry-computed dimension values; metadata scope is limited to properties, configurations, and sheet names.
  • Edits that grow a stream beyond its original compressed size raise an error on assemblies and drawings (works on parts via relocate-to-EOF, still not yet on other file types).
  • No geometry authoring; cannot create new features, modify the design tree, or perform generative operations.
  • Exact per-instance dimension counts are not yet reliable on real files; geometry decoding research is still open-ended.
  • Very small project (5 commits); reverse-engineering work is mid-progress, not production-complete.

Pick something else when…

  • SolidWorks COM API or Document ManagerYou need geometry operations, feature creation, or full CAD model manipulation.
  • SolidWorks Document Manager (paid license)You need a supported, licensed interface and want guaranteed compatibility.