Expand description
SolidWorks parts (.sldprt) and assemblies (.sldasm): import.
A SolidWorks part keeps each configuration’s body as a Parasolid partition
in neutral binary (Contents/Config-N-Partition): a section of zlib
chunks, then the partition’s rollback deltas. The file around it is an OLE
compound document (SolidWorks before 2015) or SolidWorks’ own container
(2015 and later: a ZIP-like archive with rotated stream names and raw
DEFLATE). Import finds the partition and reads it with the Parasolid
reader; nothing else in the file is needed.
An assembly keeps no bodies: swXmlContents/COMPINSTANCETREE lists the
files it uses, their models (file and configuration) and each instance
(swReference) with its placement. swTransform is a row-vector matrix in
metres: p’ = p R + t, the rotation’s rows first and the translation last
(PSAS’s canard machining assembly, exported by SolidWorks both as an
assembly and as a Parasolid assembly, agrees so to 1e-14; read as columns
it misses by 67 mm).
Container notes: blussyya/sldprt-format-research (CC-BY-SA-4.0) and the OLE compound file format ([MS-CFB]).
Structs§
- SwComponent
- One instance an assembly places.
Constants§
- MISSING_
COMPONENT_ FILE - The diagnostic code for a component whose file was not found: its instances are left out and the rest of the assembly is placed.
- VIRTUAL_
PART_ WITHOUT_ BODY - The event an import report carries for a virtual part with no body.
Functions§
- import_
solidworks_ assembly_ report - A SolidWorks assembly’s bodies, each instance’s part read through
resolve(given a file’s base name, its bytes) and placed; sub-assemblies recursively. Suppressed instances are left out. - import_
solidworks_ part_ report - A SolidWorks part’s body (its first configuration), as the Parasolid import reads it. The other configurations are named in the error when there is more than one, so a caller can say which was taken.
- solidworks_
assembly_ components - The instances a SolidWorks assembly places, from its instance tree.
- solidworks_
part_ partitions - The partition of each configuration of a SolidWorks part,
Config-0first. - solidworks_
streams - The streams of a SolidWorks document whose path (
Storage/Stream)wantaccepts, decompressed.