Context: inventorying ~800 SLDPRT/SLDASM files on macOS without a SOLIDWORKS licence, for a dataset data sheet.
Facts verified (SOLIDWORKS internal versions 8000, 10000, 18000):
- Files saved by SOLIDWORKS 2015 and later are NOT OLE2 compound documents. There is no
D0 CF 11 E0signature anywhere; the first 8 bytes vary per file and bytes 12..17 are14 00 06 00 08 00.olefileraises on them. Searching the raw bytes for UTF-16 strings finds almost nothing (streams are deflated), so grep-style provenance probes that work on DWG do not work here. swformat(https://github.com/KenM76/swformat, Apache-2.0, not on PyPI) reads the modern container in pure Python. Install for a one-off:uv run --with "swformat @ git+https://github.com/KenM76/swformat" python script.py(~5 s first time). Useful calls:swformat.tools.sw_docinfo.read_doc_metadata(path)->DocMetadata(last_modified_by, created, modified, application='SOLIDWORKS', app_version='23.0000', company, total_edit_minutes, ...)(the Office-style summary properties).swformat.api.metadata.read_metadata(path)-> dict withdoc_type('part'|'assembly'),properties(custom properties; TraceParts files carrySUPPLIER,REFERENCE,DESIGNplus opaqueattr_<hex>keys),material,configurations,dimensions(named sketch dimensions with values),keyword_index_counts.swformat.api.components.read_component_tree(path)on an SLDASM -> list ofComponent(name, path, config, hidden, suppressed, virtual, transform, bounding_box, model_ref);pathis the absolute path on the authoring machine, so missing-reference checks and provenance (vendor library folders like...\SKF\7000\...) come for free.swformat.compat.check_supported(path, warn=False)->(internal_version, status); it emitsUntestedVersionWarningfor versions outside [11000, 15000, 19000] but the reads above still worked at 8000/10000/18000.- No geometry: no bounding box of the part itself, no body count. For display meshes you need sldkit/cad3d-ir-sldprt, which are PolyForm Noncommercial (unusable for commercial profiling).
- Files downloaded from TraceParts are generated on the fly; their assembly component paths all read
C:\TPO v2\SharedFS\Outgoing\<part>.SLDPRTand child parts are numbered<slug>_01..NN.SLDPRT. Folder names of the form<9-digit id>-<format code>-<slug>(code 7 = SOLIDWORKS, 19/3 = STEP, 270/271/36 = DWG) are the portal's download record. That signature is enough to classify a batch as catalog downloads rather than an engineering firm's own models, which matters for redistribution rights.