Skip to main content

Module solidworks

Module solidworks 

Source
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-0 first.
solidworks_streams
The streams of a SolidWorks document whose path (Storage/Stream) want accepts, decompressed.